package com.icbc.cc.api;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ibm.misc.BASE64Encoder;
import com.icbc.cc.security.app.CommonHttpRequest;
import com.icbc.cte.base.CTEConstance;
import com.icbc.cte.logging.Log;
import com.icbc.cte.logging.LogFactory;


public class CallApi {

	private static Log log = LogFactory.getCtpLog(CallApi.class);
	
	//产品管理系统接口地址
	private static String API_ROOT = CTEConstance.getEnvProperty("apiRoot");
	//运营管理平台接口地址
	private static String API_ROOT1 = CTEConstance.getEnvProperty("apiRoot1");
	//糖罐儿后台管理系统接口地址
	private static String API_ROOT2 = CTEConstance.getEnvProperty("apiRoot2");
	
	//运营管理平台地址
	private static String OMAPI_ROOT = CTEConstance.getEnvProperty("omwebRoot");
	
	
	//每页页显示条数
	private static String pageNum = CTEConstance.getEnvProperty("pageNum");
	
//	private static String WEB_ROOT = CTEConstance.getEnvProperty("webRoot");
	private static String aesKey = CTEConstance.getEnvProperty("aesKey");
	private static String dsaPri = CTEConstance.getEnvProperty("dsaPri");
	private static String platformNo = CTEConstance.getEnvProperty("platformNo");
	private static String accountErrMsg = CTEConstance.getEnvProperty("accountErrMsg");
	private static String offlineMinAmount = CTEConstance.getEnvProperty("offlineMinAmount");
	private static String offlineAmountErrorMsg = CTEConstance.getEnvProperty("offlineAmountErrorMsg");
	
	//---------------------------产品---------------------------
	private static String GET_PUBLIC_INFO = "/ApiServlet?opName="; // 获取产品公共接口
	private static String GET_USER_NAME = "/ApiServlet?opName=employee_query_name"; // 获取产品列表
	private static String GET_USER_PERFORMANCE = "/ApiServlet?opName=employee_query_performance"; // 获取产品列表
	private static String GET_PRODUCT_List = "/ApiServlet?opName=product_status_querylist"; // 获取产品列表
	private static String GET_BLUR_PRODUCTList = "/ApiServlet?opName=produc_fuzzyqry_all"; // 获取产品列表
	private static String GET_TENABLEPRODUCT_List = "/ApiServlet?opName=product_querylist_bystatus"; // 获取已成立产品列表
	private static String GET_PRODUCT_DETAIL = "/ApiServlet?opName=queryprodetail_returninfo"; // 获取产品详情接口
	private static String GET_PRODUCT_PLANID = "/ApiServlet?opName=product_query_issueplanid"; // 获取产品发行方案ID
	private static String GET_PRODUCT_PLAN = "/ApiServlet?opName=product_query_issueplaninfo";//获取产品发行方案
	private static String GET_PRODUCT_OPFEE = "/ApiServlet?opName=product_query_opguidfee";//根据产品发行方案ID查询运营指导费列表接口
	private static String GET_PRODUCT_ACCOUNTINFO = "/ApiServlet?opName=query_raise_accountinfo";//查询产品募集账户信息接口
	private static String GET_PRODUCT_REMITMEMO="/ApiServlet?opName=product_query_remitmemo";//查询产品募集账户打款备注信息接口
	private static String GET_PRODUCT_PACTLIST = "/ApiServlet?opName=query_contract_list";//获取产品合同列表
	private static String GET_PRODUCT_FILELIST = "/ApiServlet?opName=query_proinfo_data";//获取产品培训资料和营销工具
	
	private static String GET_PRODUCT_GROOMLIST = "/ApiServlet?opName=query_recomnfile_list";//获取产品推荐材料列表
	private static String GET_INFODIS_LIST = "/ApiServlet?opName=infodisclosure_query_list";//获取信息披露消息
	private static String GET_PRONEWS_LIST = "/ApiServlet?opName=query_pronews_list";//获取产品消息
	private static String GET_PRONEWS_FILELIST = "/ApiServlet?opName=query_pronews_filelist";//查询产品消息相关文件列表接口
	
	private static String GET_OMNEWS_TYPELIST = "/ApiServlet?opName=opnews_query_typelist";//获取运营消息类别
	private static String GET_INFODIST_TYPELIST = "/ApiServlet?opName=infodisclosure_query_typelist";//获取信息披露消息类别
	private static String GET_PRONEWS_TYPELIST = "/ApiServlet?opName=query_pronews_typelist";//获取产品消息类别
	private static String GET_REGISTORDER_LIST = "/ApiServlet?opName=order_query_performance";//获取当日的登记订单信息
	
	private static String SUBSCRIBE_PRODUCT = "/ApiServlet?opName=common_reservation";//非标产品预约
	
	//--------------------------订单------------------------------
	private static String GET_MY_ORDERLIST	="/ApiServlet?opName=order_query";				//获取订单列表
	private static String GET_MY_MEETORDERLIST	="/ApiServlet?opName=order_query_apointlist";				//获取预约中订单列表(糖罐)
	private static String GET_APPOINT_ORDERLIST	="/ApiServlet?opName=order_tch_reservlist";				//获取预约中订单列表（运营）
	private static String UPDATE_REGIST_STATUS	="/ApiServlet?opName=order_update_registstatus";		//订单成功登记后修改订单状态(糖罐)
	private static String UPDATE_APPOINT_STATUS	="/ApiServlet?opName=order_tch_regist_update";		//订单成功登记后修改订单状态（运营）
	private static String DELETE_APPOINT_ORDER	="/ApiServlet?opName=order_tch_delreserve";		//删除预约中订单
	
	private static String GET_ORDER_REGISTERINFO	="/ApiServlet?opName=order_tgregister_prodinfo";		//获取预约中的订单登记需要信息
	private static String GET_CUSTOMERID	="/ApiServlet?opName=order_register_query_custid";		//获取预约中的订单登记需要信息
	private static String GET_ORDER_DETAIL	="/ApiServlet?opName=order_query_detail";			//获取订单详情
	private static String GET_PERSON_DETAIL	="/ApiServlet?opName=customer_authon_custinfo";			//获取订单详情
	private static String GET_CUSTADETAIL_BYCCOUNTID="/ApiServlet?opName=order_custaccountid_detail";//根据账户id获取账户信息
	private static String GET_CUSTADETAIL_BYBUSIID="/ApiServlet?opName=order_custaccount_noid_detail";//根据订单id获取账户信息
	private static String GET_PROOF_PICLIST = "/ApiServlet?opName=order_acce_moneyslip_list"; // 获取凭条照片列表
	
	private static String GET_PACT_PICLIST = "/ApiServlet?opName=order_acce_cop_list"; // 获取合同照片列表
	private static String ORDER_ACCE_DELETE = "/ApiServlet?opName=order_acce_delete"; // 合同附件删除
	private static String GET_AGENT_List = "/ApiServlet?opName=order_acce_query_agentlist"; // 模糊查询经办人列表
	private static String GET_BIRTH_CUSTLIST = "/ApiServlet?opName=customer_query_birthdaytips"; // 获取在规定天数内过生日的客户
	private static String GET_PAYMENT_ORDERLIST = "/ApiServlet?opName=order_query_paymenttips"; // 获取在投产品提醒列表
	private static String GET_FACESIGN_ORDERLIST = "/ApiServlet?opName=facesign_remind"; // 面签订单提醒
	
	//------------客户--------------------------
	private static String GET_MY_CUSTOMERASESAMNT = "/ApiServlet?opName=employee_query_custnum_asesamnt"; // 根据理财师ID获取客户列表
	private static String GET_MY_CUSTOMERLIST = "/ApiServlet?opName=customer_tch_list"; // 根据理财师ID获取客户列表
	private static String GET_CUSTOMER_MEETORDERLIST = "/ApiServlet?opName=order_query_apointlist_bycno"; // 根据客户身份证号获取客户预约中订单列表
	private static String GET_CUSTOMER_ORDERNUM = "/ApiServlet?opName=order_customer_order_num"; // 根据客户Id和客户经理Id获取订单列表
	private static String GET_CUSTOMER_ORDERLIST = "/ApiServlet?opName=order_query_orderlist_bycustid"; // 根据客户Id和客户经理Id获取订单列表
	private static String GET_CUSTOMER_SUBSISTORDERLIST = "/ApiServlet?opName=order_query_subsistinglist"; // 根据客户Id和客户经理Id获取(存续中)订单列表
	private static String GET_CUSTOMER_CLEARORDERLIST = "/ApiServlet?opName=order_query_clearedlist"; // 根据客户Id和客户经理Id获取(已清算)订单列表
	
	private static String GET_MY_CUSTOMERORDERLIST = "/ApiServlet?opName=order_query_customer_orderlist"; 
	private static String GET_CUSTOMER_INFO = "/ApiServlet?opName=customer_query_assets"; // 获取客户订单信息
	private static String GET_CUSTOMER_RISK = "/ApiServlet?opName=customer_query_transfer_assets"; // 获取客户收益权转让资产
	private static String GET_CUSTOMER_DETAIL = "/ApiServlet?opName=customer_query_personal_info"; // 获取客户个人信息
	private static String GET_CUSTOMER_RISKTEST = "/ApiServlet?opName=customer_query_risktest"; // 获取客户公私募风险测试
	
	//-----------面签---------------------------
	private static String QUERY_APT_LIST = "/ApiServlet?opName=queryAptList"; //查询预约时间与坐席数量接口
	private static String SAVE_APT_LIST = "/ApiServlet?opName=reservation"; //预约接口
	private static String CANCEL_APT_LIST = "/ApiServlet?opName=cancelReservation"; //取消预约接口
	private static String GET_INTERVIEW_INFO = "/ApiServlet?opName=order_facesign_qrydata"; //获取订单预约信息
	
	private static String EDIT_APT_STATUS = "/ApiServlet?opName=editOrderInterviewConnStatus"; //查询预约时间与坐席数量接口
	
	//------------糖罐订单详情-----------------------------------
	private static String GET_PRIVATE_PROFIT_LIST = "/ApiServlet?opName=product_query_fundvalue";//产品净值接口
	private static String GET_SEVENDAYS_LIST = "/ApiServlet?opName=product_query_sevenanualprofit";//七日年化接口
	private static String GET_PRODUCT_INFOLIST = "/ApiServlet?opName=pronews_filelist_byproid";//私募产品信息资料列表
	
	//--------------kpi考核-------------------------------------
	private static String GET_PERSON_KPI = "/ApiServlet?opName=employee_kpi_personal";//获取个人财富师kpi考核信息
	private static String GET_MEMBER_LIST = "/ApiServlet?opName=kpi_query_member_info";//获取个人财富师会员列表
	
	
	
	private static String CALL_API_REQ_METHOD = "POST";
	private static String CALL_API_CHARSET = "UTF-8";
	private static int CALL_API_TIME_OUT = 300000;

	/*------------------------------  测试数据 -------------------------------*/
//	 private static String API_ROOT = "http://172.16.6.148:8580";
//	 private static String API_ROOT1 ="http://172.16.6.124";
//	 private static String WEB_ROOT = "http://172.16.6.30:8080";
//	 private static String aesKey = "YmQ4NGMyNTBlMjQ2N2ZmNw";
//	 private static String dsaPri = "MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAP1_"
//	 + "U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq_"
//	 + "xfW6MPbLm1Vs14E7gB00b_JmYLdrmVClpJ-f6AR7ECLCT7up1_"
//	 +
//	 "63xhv4O1fnxqimFQ8E-4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC_"
//	 +
//	 "BYHPUCgYEA9-GghdabPd7LvKtcNrhXuXmUr7v6OuqC-VdMCz0HgmdRWVeOutRZT-ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN_C_"
//	 + "ohNWLx-2J6ASQ7zKTxvqhRkImog9_" + "hWuWfBpKLZl6Ae1UlZAFMO_"
//	 + "7PSSoEFgIUXiOmIDC8KZuL-PZdXcbItm9v3pI";
//	 private static String platformNo = "0001";
//	 private static String accountErrMsg = "test";

	/*------------------------------  测试数据 -------------------------------*/
	
	/**
	 * TODO 方法的描述：检查当前app版本是否禁用
	 * 
	 * @param param
	 * @return
	 */
	public static String callCheckVersionUsableApi(String osFlag,String versionNo,String param) {
		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		JSONObject paramJson=JSONObject.parseObject(newparam);
		JSONObject obj=new JSONObject();
		obj.put("flag", osFlag);
		obj.put("versionNo", versionNo);
//		if(paramJson.get("userId")!=null){
//			obj.put("userId", paramJson.get("userId"));
//		}else{
//			obj.put("userId", "");
//		}
		obj.put("userId", "");
		JSONObject objParam = new JSONObject();
		if(versionNo == null || "".equals(versionNo)){
			objParam.put("retCode", "9999");
			objParam.put("retMsg", "当前版本不可用，请更新至最新版本");
		}else{
			String 	result = ApiCommonUtils.excuteOp(obj.toJSONString(), "check_version_unable");
			
			JSONObject objResult=JSONObject.parseObject(result);
			
			
			if("0".equals(objResult.get("retCode"))){
				String totalNum=objResult.get("totalNum").toString();
				//String leaveNum=objResult.get("leaveNum").toString();
				if("0".equals(totalNum)){
//					if("0".equals(leaveNum)){
						objParam.put("retCode", "0");
						objParam.put("retMsg", "APP版本可用");
//					}else{
//						objParam.put("retCode", "7777");
//						objParam.put("retMsg", "人员已离职");
//					}
				}else{
					objParam.put("retCode", "9999");
					objParam.put("retMsg", "当前版本不可用，请更新至最新版本");
				}
			}
		}
		return objParam.toString();
	}
	
	
	/**
	 * TODO 方法的描述：获取首页图片信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetIndexApi(String param,String osFlag,String lableId) {
		JSONObject obj=new JSONObject();
		obj.put("lableId", lableId);
		obj.put("recId", osFlag);
		String 	result = ApiCommonUtils.excuteOp(obj.toString(), "get_indexlist");
		JSONObject objResult=JSONObject.parseObject(result);
		String retCode=objResult.getString("retCode");
		
		JSONObject objParam=new JSONObject();
		if("0".equals(retCode)){
			//总数
			objParam.put("totalNum", objResult.get("totalNum"));
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
				//照片列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject newjson=new JSONObject();
					//照片路径
					newjson.put("url", CTEConstance.getEnvProperty("http_path")+json.get("httpPath"));
					
					newitemList.add(newjson);
				}
				objParam.put("itemList", newitemList);
			}else{
				objParam.put("itemList", "");
			}
			objParam.put("retCode", "0");
			objParam.put("retMsg", "首页信息获取成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取首页广告信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetadsApi(String param,String osFlag) {
		JSONObject obj=new JSONObject();
		obj.put("systemId", osFlag);
		String 	result = ApiCommonUtils.excuteOp(obj.toString(), "get_ads_info");
		JSONObject objResult=JSONObject.parseObject(result);
		String retCode=objResult.getString("retCode");
		
		JSONObject objParam=new JSONObject();
		if("0".equals(retCode)){
			if("".equals(objResult.getString("httpPath"))){
				objParam.put("url", "");
				objParam.put("linkUrl","");
			}else{
				objParam.put("url", CTEConstance.getEnvProperty("http_path")+objResult.getString("httpPath"));
				objParam.put("linkUrl", objResult.getString("url"));
			}
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "首页广告信息获取成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：用户注册
	 * 
	 * @param param
	 * @return
	 */
	public static String callUserRegistApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String signParam=newparam;
		String 	result = ApiCommonUtils.excuteOp(newparam, "user_regist");
		JSONObject newobj=JSONObject.parseObject(result);
		newobj.remove("channelId");
		newobj.remove("_userId");
		newobj.remove("password");
		newobj.remove("channelid");
		newobj.remove("appVersion");
		newobj.remove("terminalCode");
		newobj.remove("type");
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		
		
		
		String 	publicResult = ApiCommonUtils.excuteOp("", "get_publicinfo");
		JSONObject publicObj=JSONObject.parseObject(publicResult);
		//客服电话
		newobj.put("servicePhone", publicObj.get("phone"));
		
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		String userresult=callGetUserInfoApi(newparam,"3");
		JSONObject userObj=JSONObject.parseObject(userresult);
		newobj.put("userName", userObj.get("userName"));
		if(userObj.get("empPostGrade") ==null || "".equals(userObj.get("empPostGrade").toString())){
			newobj.put("empPostGrade", "暂无");
		}else{
			newobj.put("empPostGrade", userObj.get("empPostGrade"));
		}
		newobj.put("empEmail", userObj.get("empEmail"));
		newobj.put("groupLevel", userObj.get("groupLevel"));
		
		JSONObject objParam = newobj;
		
		//是否设置手势密码
		String 	signResult = ApiCommonUtils.excuteOp(signParam, "have_sign_password");
		JSONObject signObj=JSONObject.parseObject(signResult);
		if("0".equals(signObj.get("retCode"))){
			objParam.put("signFlag", "1");
		}else if("-2".equals(signObj.get("retCode"))){
			objParam.put("signFlag", "0");
		}
		
		objParam.put("tag", "all");
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：用户校验验证码
	 * 
	 * @param param
	 * @return
	 */
	public static String callCheckCodeApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject obj=JSONObject.parseObject(newparam);
		obj.put("phone", obj.get("mobileNo"));
		obj.remove("mobileNo");
		String 	result = ApiCommonUtils.excuteOp(obj.toString(), "get_checkcode");
		JSONObject newobj=JSONObject.parseObject(result);
		String oldCheckCode=obj.getString("verifyCode");
		String newCheckCode=newobj.getString("checkcode");
		
		JSONObject objParam=new JSONObject();
		
		if(oldCheckCode.equals(newCheckCode)){
			String 	result1 = ApiCommonUtils.excuteOp(obj.toString(), "delete_checkcode");
			objParam.put("retCode", "0");
			objParam.put("retMsg", "验证码验证成功");
		}else{
			String 	result1 = ApiCommonUtils.excuteOp(obj.toString(), "delete_checkcode");
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "验证码输入错误");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：用户登录
	 * 
	 * @param param
	 * @return
	 */
	public static String callUserLoginApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String signParam=newparam;
		String 	result = ApiCommonUtils.excuteOp(newparam, "user_login");
		JSONObject newobj=JSONObject.parseObject(result);
		newobj.remove("channelId");
		newobj.remove("_userId");
		newobj.remove("password");
		newobj.remove("channelid");
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		
		String 	publicResult = ApiCommonUtils.excuteOp("", "get_publicinfo");
		JSONObject publicObj=JSONObject.parseObject(publicResult);
		//客服电话
		newobj.put("servicePhone", publicObj.get("phone"));
		
		
		
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		String userresult=callGetUserInfoApi(newparam,"3");
		JSONObject userObj=JSONObject.parseObject(userresult);
		
		newobj.put("userName", userObj.get("userName"));
		if(userObj.get("empPostGrade") ==null || "".equals(userObj.get("empPostGrade").toString())){
			newobj.put("empPostGrade", "暂无");
		}else{
			newobj.put("empPostGrade", userObj.get("empPostGrade"));
		}
		newobj.put("empEmail", userObj.get("empEmail"));
		newobj.put("groupLevel", userObj.get("groupLevel"));
		
		JSONObject objParam = newobj;
		
		//是否设置手势密码
		String 	signResult = ApiCommonUtils.excuteOp(signParam, "have_sign_password");
		JSONObject signObj=JSONObject.parseObject(signResult);
		if("0".equals(signObj.get("retCode"))){
			objParam.put("signFlag", "1");
		}else if("-2".equals(signObj.get("retCode"))){
			objParam.put("signFlag", "0");
		}
		objParam.put("tag", "all");
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：用户忘记密码
	 * 
	 * @param param
	 * @return
	 */
	public static String callUserResetPasswordApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String signParam=newparam;
		String 	result = ApiCommonUtils.excuteOp(newparam, "reset_password");
		JSONObject newobj=JSONObject.parseObject(result);
		newobj.remove("channelId");
		newobj.remove("_userId");
		newobj.remove("password");
		newobj.remove("channelid");
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		
		String 	publicResult = ApiCommonUtils.excuteOp("", "get_publicinfo");
		JSONObject publicObj=JSONObject.parseObject(publicResult);
		//客服电话
		newobj.put("servicePhone", publicObj.get("phone"));
		
		
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		String userresult=callGetUserInfoApi(newparam,"3");
		JSONObject userObj=JSONObject.parseObject(userresult);
		newobj.put("userName", userObj.get("userName"));
		if(userObj.get("empPostGrade") ==null || "".equals(userObj.get("empPostGrade").toString())){
			newobj.put("empPostGrade", "暂无");
		}else{
			newobj.put("empPostGrade", userObj.get("empPostGrade"));
		}
		newobj.put("empEmail", userObj.get("empEmail"));
		newobj.put("groupLevel", userObj.get("groupLevel"));
		
		JSONObject objParam = newobj;
		
		//是否设置手势密码
		String 	signResult = ApiCommonUtils.excuteOp(signParam, "have_sign_password");
		JSONObject signObj=JSONObject.parseObject(signResult);
		if("0".equals(signObj.get("retCode"))){
			objParam.put("signFlag", "1");
		}else if("-2".equals(signObj.get("retCode"))){
			objParam.put("signFlag", "0");
		}
		
		objParam.put("tag", "all");
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：校验手机号是否存在
	 * 
	 * @param param
	 * @return
	 */
	public static String callCheckPhoneApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String 	result = ApiCommonUtils.excuteOp(newparam, "check_phone_exists");
		JSONObject newobj=JSONObject.parseObject(result);
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		

		//3 将language默认语言封装到json中
		newobj.put("locale", "zh_CN");
		String userID=newobj.get("userId").toString();
		newobj.put("empId", newobj.get("userId"));
		newobj.remove("userId");
		newobj.remove("retCode");
		newobj.remove("retMsg");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_USER_NAME+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
				//员工编号
				objParam.put("userId", userID);
				//员工姓名
				objParam.put("userName", objResult.get("empName"));
							
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "员工信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：修改密码
	 * 
	 * @param param
	 * @return
	 */
	public static String callUpdatePasswordApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String 	result = ApiCommonUtils.excuteOp(newparam, "update_password");
		JSONObject newobj=JSONObject.parseObject(result);
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		

		//3 将language默认语言封装到json中
		newobj.put("locale", "zh_CN");
		String userID=newobj.get("userId").toString();
		newobj.put("empId", newobj.get("userId"));
		newobj.remove("userId");


		String retCode = newobj.getString("retCode");

		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {	
			objParam.put("retCode", "0");
			objParam.put("retMsg", "密码修改成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：用户校验验证码
	 * 
	 * @param param
	 * @return
	 */
	public static String callValidatePasswordApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject obj=JSONObject.parseObject(newparam);
		String 	result = ApiCommonUtils.excuteOp(obj.toString(), "validate_password");
		JSONObject newobj=JSONObject.parseObject(result);
		
		String retCode=newobj.getString("retCode");

		JSONObject objParam=new JSONObject();
		
		if("0".equals(retCode)){
			objParam.put("retCode", "0");
			objParam.put("retMsg", "密码验证成功");
		}else if("-2".equals(retCode)){
			objParam.put("retCode", "-2");
			objParam.put("retMsg", "密码错误");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：设置手势密码
	 * 
	 * @param param
	 * @return
	 */
	public static String callUpdateSignPasswordApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String 	result = ApiCommonUtils.excuteOp(newparam, "update_sign_password");
		JSONObject newobj=JSONObject.parseObject(result);

		String retCode = newobj.getString("retCode");

		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {	
			objParam.put("retCode", "0");
			objParam.put("retMsg", "手势密码设置成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：手势密码登录
	 * 
	 * @param param
	 * @return
	 */
	public static String callUserSignLoginApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String 	result = ApiCommonUtils.excuteOp(newparam, "user_sign_login");
		JSONObject newobj=JSONObject.parseObject(result);
		newobj.remove("channelId");
		newobj.remove("_userId");
		newobj.remove("password");
		newobj.remove("channelid");
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		
		String 	publicResult = ApiCommonUtils.excuteOp("", "get_publicinfo");
		JSONObject publicObj=JSONObject.parseObject(publicResult);
		//客服电话
		newobj.put("servicePhone", publicObj.get("phone"));
		
		
		
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		String userresult=callGetUserInfoApi(newparam,"3");
		JSONObject userObj=JSONObject.parseObject(userresult);
		
		newobj.put("userName", userObj.get("userName"));
		if(userObj.get("empPostGrade") ==null || "".equals(userObj.get("empPostGrade").toString())){
			newobj.put("empPostGrade", "暂无");
		}else{
			newobj.put("empPostGrade", userObj.get("empPostGrade"));
		}
		newobj.put("empEmail", userObj.get("empEmail"));
		newobj.put("groupLevel", userObj.get("groupLevel"));
		
		JSONObject objParam = newobj;
		objParam.put("tag", "all");
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：版本检测接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callCheckVersionApi(String param,String osFlag) {
		//1 解密
		//String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramObj= new JSONObject();
		if("5".equals(osFlag)){
			paramObj.put("osFlag", "1");
			String 	result = ApiCommonUtils.excuteOp(paramObj.toJSONString(), "check_version");
			JSONObject newobj=JSONObject.parseObject(result);
			
			paramObj.put("osFlag", "2");
			String 	result1 = ApiCommonUtils.excuteOp(paramObj.toJSONString(), "check_version");
			JSONObject obj=JSONObject.parseObject(result1);
			
			newobj.put("androidDownloadLink", obj.get("downloadLink"));
			return newobj.toString();
		}else{
			paramObj.put("osFlag", osFlag);
		}
		
		String 	result = ApiCommonUtils.excuteOp(paramObj.toJSONString(), "check_version");
		JSONObject newobj=JSONObject.parseObject(result);
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		if("1".equals(osFlag)){
			newobj.put("downloadLink", CTEConstance.getEnvProperty("http_path")+"download/download.html");
		}
		
		//3 将language默认语言封装到json中
//		newobj.put("locale", "zh_CN");
//		String userID=newobj.get("userId").toString();
//		newobj.put("empId", newobj.get("userId"));
//		newobj.remove("userId");
//		newobj.remove("retCode");
//		newobj.remove("retMsg");

		return newobj.toString();
	}
	
	/**
	 * TODO 方法的描述：关于我们接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callCheckDescribeApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String 	result = ApiCommonUtils.excuteOp(newparam, "check_describe");
		JSONObject newobj=JSONObject.parseObject(result);
		if(!"0".equals(newobj.get("retCode"))){
			return newobj.toString();
		}
		

		//3 将language默认语言封装到json中
		newobj.put("locale", "zh_CN");
//		String userID=newobj.get("userId").toString();
		newobj.put("empId", newobj.get("userId"));
		newobj.remove("userId");

		return newobj.toString();
	}

	/**
	 * TODO 方法的描述：私人订制期限列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetTailorTermListpi(String param,String osFlag) {
		
		JSONObject obj = new JSONObject();
		obj.put("categoryname", "私人订制客户类型");
		obj.put("locale", "zh_CN");
		String 	result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_optionlist");
		JSONObject newobj=JSONObject.parseObject(result);
		JSONArray arrOptionData = (JSONArray)newobj.get("itemList"); 
		JSONArray optionAyyay=new JSONArray();
		JSONObject objParam = new JSONObject();
		
		if("0".equals(newobj.getString("retCode"))){
			//获取状态列表
			for(int i=0;i<arrOptionData.size();i++){
				JSONObject json=(JSONObject)arrOptionData.get(i);
				JSONObject newjson=new JSONObject();
				newjson.put("primary", json.get("optionValue"));
				newjson.put("value", json.get("optionName"));
				optionAyyay.add(newjson);
			}
			objParam.put("itemList", optionAyyay);
			objParam.put("retCode", "0");
			objParam.put("retMsg", "私人订制客户类型获取成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "私人订制客户类型获取失败");
			log.info("retMsg result:状态列表获取失败" + " 参数categoryname:产品状态");
		}
		return objParam.toString();
	}
	
	/**
	 * TODO 私人订制接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callSaveTailorApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		String 	result = ApiCommonUtils.excuteOp(newparam, "insert_tailor");
		JSONObject newobj=JSONObject.parseObject(result);
		JSONObject objParam = new JSONObject();
		if("0".equals(newobj.get("retCode"))){
			objParam.put("retCode", "0");
			objParam.put("retMsg", "私人订制信息存储成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取获取公募/私募业绩
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetUserPerformanceApi (String param,String osFlag) {
				
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject newobj=JSONObject.parseObject(newparam);
		//3 将language默认语言封装到json中
		newobj.put("custManagerId", newobj.get("userId"));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_USER_PERFORMANCE+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
				
				//财富师姓名
				objParam.put("publicAssetsAmount", objResult.get("publicAssetsAmount"));
				//财富师邮箱
				objParam.put("privateAssetsAmount", objResult.get("privateAssetsAmount"));			
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "员工公募/私募业绩获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取个人资料
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetUserInfoApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject newobj=JSONObject.parseObject(newparam);
//		
//		String 	result = ApiCommonUtils.excuteOp(newobj.toString(), "query_chanelid");
//		JSONObject userobj=JSONObject.parseObject(result);
		newobj.put("empId", newobj.get("userId"));
		newobj.put("locale", "zh_CN");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(newobj.toJSONString(), "3");
		
		//获取公募/私募业绩
		String performance=callGetUserPerformanceApi(param,osFlag);
		JSONObject performanceobj=JSONObject.parseObject(performance);
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_USER_NAME+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
				
				//财富师姓名
				objParam.put("userName", objResult.get("empName"));
				//财富师邮箱
				objParam.put("empEmail", objResult.get("empEmail"));	
				//财富师岗位级别
				objParam.put("empPostGrade", objResult.get("cfsLevel"));
				//财富师工号
				objParam.put("userId", newobj.get("userId"));
				//财富师电话
				objParam.put("mobileNo", objResult.get("empMobile"));	
				//财富师管理部
				objParam.put("group", objResult.get("dept"));
				//财富师所属中心
				objParam.put("kernel", objResult.get("center"));
				//财富师所属业务部
				objParam.put("business", objResult.get("company"));
				//团队级别"groupLevel":""团队级别（0普通财富师；1一级团队长（财富管理部）；2二级团队长（财富中心）；3三级团队长（业务部）；6不参加KPI考核）
				objParam.put("groupLevel", objResult.getString("groupLevel"));
				
				
				JSONArray contentList=new JSONArray();
				
				JSONObject publicContent=new JSONObject();
				publicContent.put("title", "公募存续标准业绩");
				publicContent.put("value", performanceobj.get("publicAssetsAmount"));
				contentList.add(publicContent);
				
				JSONObject privateContent=new JSONObject();
				privateContent.put("title", "私募存续标准业绩");
				privateContent.put("value", performanceobj.get("privateAssetsAmount"));
				contentList.add(privateContent);
				
				//---------------------------------------------注意:数据不准暂时不取-------------------------------
				//objParam.put("contentList", contentList);
				objParam.put("contentList", "");
				objParam.put("retCode", "0");
				objParam.put("retMsg", "员工信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：我的产品列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyProductListApi(String param,String osFlag,String apiName) {

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		if(paramJson.get("proType")==null || "".equals(paramJson.get("proType").toString())){
			paramJson.put("proType", "1");
		}
		String proType=paramJson.get("proType").toString();
		if("7".equals(proType)){
			paramJson.put("proStatus", "6");
		}
		paramJson.put("busiId", paramJson.get("orderId"));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String api="";
		//已成立产品接口调用不同
		if("7".equals(proType)){
			api=GET_TENABLEPRODUCT_List;
		}else{
			api=GET_PRODUCT_List;
		}
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + api+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);				
				//私人订制链接
				objParam.put("tailorLink", CTEConstance.getEnvProperty("http_path")+"HTML5/html/personal_tailor.html?userId="+paramJson.get("userId"));
				//私人订制名称
				objParam.put("tailorName", "私人订制");
				
				if("get_product_StatusList".equals(apiName)){
					String version=callCheckVersionApi("",osFlag);
					JSONObject versionObj=JSONObject.parseObject(version);
					objParam.put("updateContent", versionObj.get("updateContent"));
					objParam.put("versionNo", versionObj.get("versionNo"));
					objParam.put("downloadLink", versionObj.get("downloadLink"));
					
					JSONObject bannerobj = new JSONObject();
					String 	bannerresult = ApiCommonUtils.excuteOp(bannerobj.toString(), "public_get_bannerlist");
					JSONObject newbannerobj=JSONObject.parseObject(bannerresult);
					if("0".equals(newbannerobj.get("retCode").toString())){
						objParam.put("bannerList", newbannerobj.get("bannerList"));
					}
					
					//获取状态列表
					JSONObject obj = new JSONObject();
					obj.put("categoryname", "产品状态");
					obj.put("locale", "zh_CN");
					String 	result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_optionlist");
					JSONObject newobj=JSONObject.parseObject(result);
					JSONArray arrOptionData = (JSONArray)newobj.get("itemList"); 
					JSONArray optionAyyay=new JSONArray();
					
					if("0".equals(newobj.getString("retCode"))){
						//获取状态列表
						for(int i=0;i<arrOptionData.size();i++){
							JSONObject json=(JSONObject)arrOptionData.get(i);
							JSONObject newjson=new JSONObject();
							if("0".equals(json.get("optionValue").toString())){
								continue;
							}
							newjson.put("title", json.get("optionName"));
							newjson.put("value", json.get("optionValue"));
							optionAyyay.add(newjson);
						}
					}else{
						objParam.put("retCode", "-1");
						objParam.put("retMsg", "状态列表获取失败");
						log.info("retMsg result:状态列表获取失败" + " 参数categoryname:产品状态");
					}
					objParam.put("statusList", optionAyyay);
				}
				
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//产品列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						//产品id
						newjson.put("prodId", json.get("id"));
						//产品名称
						newjson.put("prodName", json.get("proName"));
						//产品编码
						newjson.put("proCode", json.get("proCode"));
						
						//收益类型
						newjson.put("profitType", json.get("profitType"));
						String profitType=json.get("profitType").toString();
						//进度
						java.text.DecimalFormat   df   =new   java.text.DecimalFormat("0.0");
						//剩余额度
						float remainamount=Float.parseFloat(json.get("remainamount").toString());
						//总额度
						float issueAmount=Float.parseFloat(json.get("issueAmount").toString());					
						newjson.put("rate", df.format((issueAmount-remainamount)/issueAmount));
						
						JSONArray productShow =new JSONArray();
						
						//基准年化收益率
						JSONObject ratejson=new JSONObject();
						ratejson.put("title", "基准年化收益率");
						if("2".equals(profitType)){
							ratejson.put("value",  "浮动");
						}else{
							ratejson.put("value",  json.get("returnRate").toString()+"%");
						}
						
						productShow.add(ratejson);
						
						//期限
						JSONObject termjson=new JSONObject();
						termjson.put("title", "期限");
						termjson.put("value",  json.get("termvalue"));
						productShow.add(termjson);
						
						//起投金额
						JSONObject lpayjson=new JSONObject();
						String lpayLimit=(json.get("lpayLimit")==null||"".equals(json.get("lpayLimit")))?"0":json.get("lpayLimit").toString();
						lpayjson.put("title", "起投金额");
						if("4".equals(json.get("prodType2").toString())){
							lpayjson.put("value",  json.get("lpayLimit").toString()+"万美元");
						}else{
							if("5".equals(json.get("prodType2").toString())&&Integer.parseInt(lpayLimit)<100){
								lpayjson.put("value",  "100万元");
							}else{
								lpayjson.put("value",  json.get("lpayLimit").toString()+"万元");
							}
							
						}
						
						productShow.add(lpayjson);
						
						//总额度
						JSONObject totaljson1=new JSONObject();
						totaljson1.put("title", "总规模:");
						if("4".equals(json.get("prodType2").toString())){
							totaljson1.put("value",  json.get("issueAmount").toString()+"万美元");
						}else{
							totaljson1.put("value",  json.get("issueAmount").toString()+"万");
						}
						
						productShow.add(totaljson1);
						
						//剩余额度
						JSONObject lastjson1=new JSONObject();
						lastjson1.put("title", "剩余额度:");
						if("4".equals(json.get("prodType2").toString())){
							lastjson1.put("value",  json.get("remainamount").toString()+"万美元");
						}else{
							lastjson1.put("value",  json.get("remainamount").toString()+"万");
						}
						
						productShow.add(lastjson1);
						
						newjson.put("productShow", productShow);
						
						
						
						JSONArray productDetail =new JSONArray();
						
						//总额度
						JSONObject totaljson=new JSONObject();
						totaljson.put("title", "总规模:");
						if("4".equals(json.get("prodType2").toString())){
							totaljson.put("value",  json.get("issueAmount").toString()+"万美元");
						}else{
							totaljson.put("value",  json.get("issueAmount").toString()+"万");
						}
						
						productDetail.add(totaljson);
						
						//剩余额度
						JSONObject lastjson=new JSONObject();
						lastjson.put("title", "剩余额度:");
						if("4".equals(json.get("prodType2").toString())){
							lastjson.put("value",  json.get("remainamount").toString()+"万美元");
						}else{
							lastjson.put("value",  json.get("remainamount").toString()+"万");
						}
						
						productDetail.add(lastjson);
						
						
						
						
						if(json.get("remainingQuota")!=null && !"".equals(json.get("remainingQuota").toString())){
							//剩余名额
							JSONObject quotaJson=new JSONObject();
							quotaJson.put("title", "剩余名额:");
							quotaJson.put("value",  json.get("remainingQuota").toString()+"人");
							productDetail.add(quotaJson);
						}else{
							JSONObject quotaJson=new JSONObject();
							quotaJson.put("title", "剩余名额:");
							quotaJson.put("value", "无限制");
							productDetail.add(quotaJson);
						}
						
						
						newjson.put("productDetail", productDetail);
						
						newitemList.add(newjson);
					}
					objParam.put("productList", newitemList);
				}else{
					objParam.put("productList", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取最新上架的推荐产品
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetNewProductListApi(String param,String osFlag,String apiName) {

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("begNum", "1");
		paramJson.put("fetchNum", "5");
		paramJson.put("condition", "");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_BLUR_PRODUCTList+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			

				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//产品列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						//产品id
						newjson.put("prodId", json.get("id"));
						//产品名称
						newjson.put("prodName", json.get("proName").toString());
						//产品编码
						newjson.put("proCode", json.get("proCode"));
						
						newitemList.add(newjson);
					}
					objParam.put("productList", newitemList);
				}else{
					objParam.put("productList", "");
				}
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
				
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：模糊查询产品列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyBlurProductListApi(String param,String osFlag,String apiName) {

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_BLUR_PRODUCTList+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);				

				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//产品列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						//产品id
						newjson.put("prodId", json.get("id"));
						//产品名称
						newjson.put("prodName", json.get("proName"));
						//产品编码
						newjson.put("proCode", json.get("proCode"));
						
						//收益类型
						newjson.put("profitType", json.get("profitType"));
						String profitType=json.get("profitType").toString();
						//进度
						java.text.DecimalFormat   df   =new   java.text.DecimalFormat("0.0");
						String remainamountObj="0";
						String issueAmountObj="0";
						if(json.get("remainamount")!=null && !"".equals(json.get("remainamount").toString())){
							remainamountObj=json.get("remainamount").toString();
						}
						if(json.get("issueAmount")!=null && !"".equals(json.get("issueAmount").toString())){
							issueAmountObj=json.get("issueAmount").toString();
						}
						//剩余额度
						float remainamount=Float.parseFloat(remainamountObj);
						//总额度
						float issueAmount=Float.parseFloat(issueAmountObj);			
						if(issueAmount==0){
							newjson.put("rate", "0");
						}else{
							newjson.put("rate", df.format((issueAmount-remainamount)/issueAmount));
						}
						
						
						JSONArray productShow =new JSONArray();
						
						//基准年化收益率
						JSONObject ratejson=new JSONObject();
						ratejson.put("title", "基准年化收益率");
						if("2".equals(profitType)){
							ratejson.put("value",  "浮动");
						}else{
							ratejson.put("value",  json.get("returnRate").toString()+"%");
						}
						
						productShow.add(ratejson);
						
						//期限
						JSONObject termjson=new JSONObject();
						termjson.put("title", "期限");
						termjson.put("value",  json.get("termvalue"));
						productShow.add(termjson);
						
						//起投金额
						JSONObject lpayjson=new JSONObject();
						lpayjson.put("title", "起投金额");
						//运营中4是离岸金融
						String lpayLimit=(json.get("lpayLimit")==null||"".equals(json.get("lpayLimit")))?"0":json.get("lpayLimit").toString();
						if("4".equals(json.get("prodType2").toString())){
							lpayjson.put("value",  json.get("lpayLimit").toString()+"万美元");
						}else{
							if("5".equals(json.get("prodType2").toString())&&Integer.parseInt(lpayLimit)<100){
								lpayjson.put("value",  "100万元");
							}else{
								lpayjson.put("value",  json.get("lpayLimit").toString()+"万元");
							}
							
						}
						
						productShow.add(lpayjson);
						
						//总额度
						JSONObject totaljson=new JSONObject();
						totaljson.put("title", "总规模:");
						if("4".equals(json.get("prodType2").toString())){
							totaljson.put("value",  issueAmountObj+"万美元");
						}else{
							
							totaljson.put("value",  issueAmountObj+"万");
						}
						
						productShow.add(totaljson);
						
						//剩余额度
						JSONObject lastjson=new JSONObject();
						lastjson.put("title", "剩余额度:");
						if("4".equals(json.get("prodType2").toString())){
							lastjson.put("value",  remainamountObj+"万美元");
						}else{
							lastjson.put("value",  remainamountObj+"万");
						}
						
						productShow.add(lastjson);
						
						newjson.put("productShow", productShow);
						newitemList.add(newjson);
					}
					objParam.put("productList", newitemList);
					objParam.put("retCode", "0");
					objParam.put("retMsg", "订单列表获取成功");
				}else{
					objParam.put("productList", "");
					objParam.put("retCode", "0");
					objParam.put("retMsg", "未搜索到您想要的结果");
				}
				
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取产品详情
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductDetailApi(String param,String osFlag) {
		
		//传入参数
		//procId：产品ID
	    //begNum: 开始行号
	    //fetchNum: 结束行号callGetOrderRegisterInfoApi
	    //language: 语言格式
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将language默认语言封装到json中
		paramJson.put("language", "zh_CN");
		paramJson.put("begNum", "1");
		paramJson.put("fetchNum", "1000");
		paramJson.put("id", paramJson.get("prodId"));
		paramJson.put("prdId", paramJson.get("proCode"));

		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_DETAIL+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			JSONObject inObj=new JSONObject();
			inObj.put("prdId", objResult.get("proCode"));
			String inparam = ApiCommonUtils.encrypAndSign(inObj.toJSONString(), "3");
			String proObj=callGetOrderRegisterInfoApi(inparam,osFlag);
			JSONObject proInfo=JSONObject.parseObject(proObj);
			//产品名称	
			objParam.put("prodName", proInfo.get("prodName"));
			//产品编号
			objParam.put("proCode", proInfo.get("proCode"));
			
			JSONObject proJson=new JSONObject();
			proJson.put("prodId", paramJson.get("prodId"));
			String proparam = ApiCommonUtils.encrypAndSign(proJson.toJSONString(), "3");
			callGetProductFileListApi(proparam,"3");
			String profitType=objResult.get("profitType").toString();
			//基准年华收益率
			if("2".equals(profitType)){
				objParam.put("value1", "浮动");
			}else{
				objParam.put("value1", proInfo.get("returnRate").toString()+"%");
			}
			
			objParam.put("title1", "基准年化收益率");
			
			//起投金额
			objParam.put("value2", proInfo.get("lpayLimit").toString()+"万");
			objParam.put("title2", "起投金额");
			
			
			//期限
			objParam.put("value3", proInfo.get("termValue").toString());
			objParam.put("title3", "期限");
			
			//剩余额度
			objParam.put("value4", proInfo.get("remainAmount").toString()+"万");
			objParam.put("title4", "剩余额度");			
			
			//发行额度
			objParam.put("issueAmount", proInfo.get("issueAmount"));
			//发行日期
			objParam.put("issueDate", objResult.get("issueDate"));
			
			//获取收益类型名称
			JSONObject obj = new JSONObject();
			obj.put("dictid", objResult.get("profitType"));
			obj.put("dicttype", "PROPROFITTYPE");
			obj.put("dictlang", "zh_CN");
			String 	result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_dictnamebyid");
			JSONObject newobj=JSONObject.parseObject(result);
			
			if("0".equals(newobj.getString("retCode"))){
				//收益类型
				objParam.put("profitType", newobj.get("name").toString());
			}else{
				objParam.put("profitType","");
				objParam.put("retCode", "1");
				objParam.put("retMsg", "收益类型获取失败");
				log.info("retMsg result:收益类型获取失败" + " 参数profitType:"+objResult.get("profitType"));
			}
			
			
			//获取付息方式名称
			obj.put("dictid", objResult.get("interestPayment"));
			obj.put("dicttype", "PROINTERESTPAYMENT");
			obj.put("dictlang", "zh_CN");
			String 	result1 = ApiCommonUtils.excuteOp(obj.toString(), "public_get_dictnamebyid");
			JSONObject newobj1=JSONObject.parseObject(result1);
			
			if("0".equals(newobj1.getString("retCode"))){
				//付息方式
				objParam.put("interestPayment", newobj1.get("name").toString());
			}else{
				objParam.put("interestPayment","");
				objParam.put("retCode", "1");
				objParam.put("retMsg", "付息方式获取失败");
				log.info("retMsg result:付息方式获取失败" + " 参数interestPayment:"+objResult.get("interestPayment"));
			}
			
			
			//产品经理
			objParam.put("proManager", objResult.get("proManagerName"));
			//产品经理电话
			objParam.put("managePhone", objResult.get("managePhone"));
			//管理人
			objParam.put("adminName", objResult.get("adminName"));
			//期限备注
			objParam.put("termRemark", objResult.get("termRemark"));
			
			
//			String dataResult = ApiCommonUtils.excuteOp(paramJson.toString(), "public_get_proddatalist");
//			JSONObject dataobj=JSONObject.parseObject(dataResult);
//			if(dataobj.get("dataList") !=null && !"".equals(dataobj.get("dataList").toString())){
//				//收益方案
//				JSONArray arrRespData = (JSONArray)dataobj.get("dataList"); 
//
//				for(int i=0;i<arrRespData.size();i++){
//					JSONObject json=(JSONObject)arrRespData.get(i);
//					String datatype=json.getString("datatype");
//					if("1".equals(datatype)){
//						//ppt
//						objParam.put("powerPoint", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=1&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("2".equals(datatype)){
//						//录音
//						objParam.put("sound", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=2&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("3".equals(datatype)){
//						//视频
//						objParam.put("video", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=3&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("4".equals(datatype)){
//						//Q&A
//						objParam.put("questionAnswer", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=4&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("5".equals(datatype)){
//						//一页通
//						objParam.put("onePage", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=5&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("6".equals(datatype)){
//						//亮点提炼
//						objParam.put("brightPoint", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=6&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("7".equals(datatype)){
//						//案例集锦
//						objParam.put("case", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=7&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//						objParam.put("caseName", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=7&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("8".equals(datatype)){
//						//相关软文
//						objParam.put("advertorial", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=8&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("9".equals(datatype)){
//						//发行方案
//						objParam.put("issueCase", CTEConstance.getEnvProperty("http_path")+"HTML5/html/Product_release.html?type=9&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("10".equals(datatype)){
//						//产品合同
//						objParam.put("pact", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=10&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("11".equals(datatype)){
//						//推荐材料
//						objParam.put("groom", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=11&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("12".equals(datatype)){
//						//募集账户
//						objParam.put("accountinfo", CTEConstance.getEnvProperty("http_path")+"HTML5/html/To_raise.html?type=12&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}else if("13".equals(datatype)){
//						//运营要求
//						objParam.put("omask", CTEConstance.getEnvProperty("http_path")+"HTML5/html/yunying_require.html?type=13&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
//					}
//				}
//
//			}else{
//				objParam.put("powerPoint", "");
//				objParam.put("sound", "");
//				objParam.put("video", "");
//				objParam.put("questionAnswer", "");
//				objParam.put("onePage", "");
//				objParam.put("brightPoint", "");
//				objParam.put("case", "");
//				objParam.put("caseName", "");
//				objParam.put("advertorial", "");
//				objParam.put("issueCase", "");
//				objParam.put("pact", "");
//				objParam.put("groom", "");
//				objParam.put("accountinfo", "");
//				objParam.put("omask", "");
//			}
			//ppt
			//objParam.put("powerPoint", CTEConstance.getEnvProperty("http_path")+"HTML5/html/make_img.html?type=1&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			objParam.put("powerPoint", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=1&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//录音
			objParam.put("sound", CTEConstance.getEnvProperty("http_path")+"HTML5/html/avideo.html?type=2&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//视频
			objParam.put("video", CTEConstance.getEnvProperty("http_path")+"HTML5/html/avideo.html?type=3&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//Q&A
			objParam.put("questionAnswer", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=4&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//一页通
			objParam.put("onePage", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=5&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//亮点提炼
			objParam.put("brightPoint", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=6&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//案例集锦
			objParam.put("case", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=7&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			objParam.put("caseName", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=7&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//相关软文
			objParam.put("advertorial", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=8&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//发行方案
			objParam.put("issueCase", CTEConstance.getEnvProperty("http_path")+"HTML5/html/Product_release.html?type=9&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//产品合同
			objParam.put("pact", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=10&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//推荐材料
			objParam.put("groom", CTEConstance.getEnvProperty("http_path")+"HTML5/html/tuijian_material.html?type=11&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//募集账户
			objParam.put("accountinfo", CTEConstance.getEnvProperty("http_path")+"HTML5/html/To_raise.html?type=12&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			//运营要求
			objParam.put("omask", CTEConstance.getEnvProperty("http_path")+"HTML5/html/yunying_require.html?type=13&prodId="+paramJson.get("prodId")+"&prodCode="+proInfo.get("proCode")+"&userId="+paramJson.get("userId"));
			
			
			JSONArray upList=new JSONArray();
			JSONArray downList=new JSONArray();
			JSONArray rateList=new JSONArray();
			
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//收益方案
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject upjson=new JSONObject();
					JSONObject downjson=new JSONObject();
					JSONObject ratejson=new JSONObject();
					
					if(json.get("upLimit")==null || "".equals(json.get("upLimit").toString())){
						//上限
						upjson.put("value", "-");
					}else{
						//上限
						upjson.put("value", json.get("upLimit").toString()+"万");
					}
					
					upList.add(upjson);
					
					if(json.get("lowLimit")==null || "".equals(json.get("lowLimit").toString())){
						//下限
						downjson.put("value", "-");
					}else{
						//下限
						downjson.put("value", json.get("lowLimit").toString()+"万");
					}
					
					downList.add(downjson);
					
					if(json.get("returnRate")==null || "".equals(json.get("returnRate").toString())){
						//年化收益率
						ratejson.put("value", "-");
					}else{
						//年化收益率
						ratejson.put("value", json.get("returnRate").toString()+"%");
					}
					rateList.add(ratejson);

				}
				objParam.put("upList", upList);
				objParam.put("downList", downList);
				objParam.put("rateList", rateList);
			}else{
				objParam.put("upList", "");
				objParam.put("downList", "");
				objParam.put("rateList", "");
			}
			
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "产品基本资料请求成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	
	/**
	 * TODO 方法的描述：获取产品培训资料和营销工具
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductFileListApi(String param,String osFlag) {
		

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("prodId", paramJson.get("prodId"));
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_FILELIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//材料列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						String type=json.getString("type");
//						JSONObject projson=new JSONObject();
//						projson.put("prodId", json.get("prodid"));
//						projson.put("productType", json.get("type"));
//						String proResult = ApiCommonUtils.excuteOp(projson.toJSONString(), "get_product_filelist");
//						JSONObject proobj=JSONObject.parseObject(proResult);
//						String proCode = proobj.getString("retCode");
//						if(proobj.getIntValue("totalNum")<1){
//							
//						}
						if(!"2".equals("type")&&!"3".equals(type)){
							JSONObject injson=new JSONObject();
							injson.put("fileId", json.get("id"));
							String oldResult = ApiCommonUtils.excuteOp(injson.toJSONString(), "get_fileinfo");
							JSONObject oldobj=JSONObject.parseObject(oldResult);
							String oldCode = oldobj.getString("retCode");
							
							if("0".equals(oldCode)){
								int totalnum=oldobj.getIntValue("totalNum");
								if(totalnum<1){
									JSONObject newjson=new JSONObject();

									newjson.put("httpPath", json.get("httppath"));
									newjson.put("fileId", json.get("id"));
									newjson.put("fileType", json.get("filetype"));
									newjson.put("sourceId", paramJson.get("prodId"));								
									newjson.put("productType", json.get("type"));
									//附件服务器地址
									newjson.put("fileServerPath", CTEConstance.getEnvProperty("pmfileServerPath"));
									
									//String fileparam = ApiCommonUtils.encrypAndSign(newjson.toJSONString(), "3");
									
									String fileResult = ApiCommonUtils.excuteOp(newjson.toJSONString(), "fileupload");
									JSONObject fileobj=JSONObject.parseObject(fileResult);
									String fileCode = fileobj.getString("retCode");
									
									if("0".equals(fileCode)){
										

										JSONObject custjson=new JSONObject();
										custjson.put("title", json.get("fileName"));
										custjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("httppath").replaceAll("uploadFiles", "uploadfiles"));
										
										//获取小图标图片地址
										//JSONObject typeObj=new JSONObject();
										//typeObj.put("imageType", json.get("fileType"));
										//String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
										//JSONObject urlobj=JSONObject.parseObject(typeResult);
										//custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
										newitemList.add(custjson);
									}else{
										objParam.put("retCode", "-1");
										objParam.put("retMsg", "产品附件列表下载失败");
									}
								}else{
									JSONObject custjson=new JSONObject();
									custjson.put("title", oldobj.get("fileName"));
									custjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath"));
									
									//获取小图标图片地址
//									JSONObject typeObj=new JSONObject();
//									typeObj.put("imageType", oldobj.get("fileType"));
//									String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
//									JSONObject urlobj=JSONObject.parseObject(typeResult);
//									custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
									newitemList.add(custjson);
								}
							}
						}
						
						
						
						
					}
				}
				
				//objParam.put("content", newitemList);
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品附件列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取产品培训资料和营销工具
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductTrainListApi(String param,String osFlag) {
		

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("productType", paramJson.get("type"));
		if(paramJson.get("prodCode") != null){
			paramJson.put("prodId", paramJson.get("prodCode"));
		}
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_FILELIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//材料列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					
					for(int i=0;i<arrRespData.size();i++){
						String type=paramJson.get("type").toString();
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						if("2".equals(type) || "3".equals(type)){
							newjson.put("title", json.get("urlStr"));
							newjson.put("value", json.get("urlPassword"));
							newjson.put("producttype", paramJson.get("type"));
							newjson.put("type", "");
						}else{
							newjson.put("title", json.get("filename"));
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.get("httppath"));
							newjson.put("producttype", paramJson.get("type"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", json.get("filetype"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
						}
						
						newitemList.add(newjson);
					}
					objParam.put("content", newitemList);
				}else{
					objParam.put("content", "");
				}
				
				//objParam.put("content", newitemList);
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品资料获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
//		String oldResult = ApiCommonUtils.excuteOp(paramJson.toJSONString(), "get_product_filelist");
//		JSONObject objResult=JSONObject.parseObject(oldResult);
//		
//		String retCode = objResult.getString("retCode");
//		
//		JSONObject objParam = new JSONObject();
//
//		if ("0".equals(retCode)) {
//
//				List<JSONObject> newitemList=new ArrayList<JSONObject>();
//				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum"))){
//					//材料列表
//					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
//
//					
//					for(int i=0;i<arrRespData.size();i++){
//						JSONObject json=(JSONObject)arrRespData.get(i);
//						JSONObject newjson=new JSONObject();
//						//newjson.put("value", json.get("httppath"));
//						newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.get("httppath"));
//						newjson.put("producttype", paramJson.get("type"));
//						newitemList.add(newjson);
//					}
//					objParam.put("content", newitemList);
//				}else{
//					objParam.put("content", "");
//				}
//				
//				
//			
//				objParam.put("retCode", "0");
//				objParam.put("retMsg", "产品资料获取成功");
//		}  else {
//
//			objParam.put("retCode", "-1");
//			objParam.put("retMsg", "处理失败，请联系客服");
//		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取产品发行方案
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductIssueplanApi(String param,String osFlag) {
		
		//1 解密
		String newparam1 = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject newparamJson=JSONObject.parseObject(newparam1);
		//4 加密
		newparam1 = ApiCommonUtils.encrypAndSign(newparam1, "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PRODUCT_PLANID+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam1, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			JSONObject paramJson = new JSONObject();
			paramJson.put("id", objResult.get("issuePlanId"));
			//paramJson.put("id", "1722");
			paramJson.put("begNum", "0");
			paramJson.put("fetchNum", "1000");
			paramJson.put("user", newparamJson.get("userId"));
			paramJson.put("locale", "zh_CN");
			String newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			
			
			try {
				remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PRODUCT_PLAN+"&osFlag="+3,
						CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
						"param=" + newparam, CALL_API_CHARSET);
			} catch (Exception e) {
				e.printStackTrace();
			}
			String str1 = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
			JSONObject planResult = (JSONObject) JSONObject.parse(str1);
			String planCode = planResult.getString("retCode");
			if ("0".equals(planCode)) {
				JSONArray itemList=new JSONArray();
				JSONArray newitemList=new JSONArray();
				
				JSONObject json1=new JSONObject();
				json1.put("title", "大额起点(万)");
				json1.put("value", planResult.get("largeOrig"));
				itemList.add(json1);
				
				JSONObject json2=new JSONObject();
				json2.put("title", "最低打款额度(万)");
				json2.put("value", planResult.get("lpayLimit"));
				itemList.add(json2);
				
				objParam.put("little", itemList);
				
				JSONObject json3=new JSONObject();
				json3.put("title", "是否全辖发行");
				if(planResult.get("isall") !=null){
					if("1".equals(planResult.get("isall").toString())){
						json3.put("value", "是");
					}else{
						json3.put("value", "否");
					}
				}else{
					json3.put("value", "否");
				}
				newitemList.add(json3);
				
//				JSONObject json4=new JSONObject();
//				json4.put("title", "产品经理");
//				json4.put("value", planResult.getString("createuser")+planResult.getString("createuserName")+"("+planResult.getString("createuserDepartment")+")");
//				newitemList.add(json4);
//				
//				JSONObject json5=new JSONObject();
//				json5.put("title", "产品经理电话");
//				json5.put("value", planResult.get("createuserTel"));
//				newitemList.add(json5);
				
				JSONObject json6=new JSONObject();
				json6.put("title", "产品系数");
				json6.put("value", planResult.get("confactor"));
				newitemList.add(json6);
				
				JSONObject json7=new JSONObject();
				json7.put("title", "是否是会员产品");
				String tmp="";
				if(planResult.get("isMember")!=null){
					String isMember=planResult.get("isMember").toString();
					if("0".equals(isMember)){
						tmp="常规";
					}else if("1".equals(isMember)){
						tmp="会员";
					}else{
						tmp="定制";
					}
				}
				json7.put("value", tmp);
				newitemList.add(json7);
				
				JSONObject json8=new JSONObject();
				json8.put("title", "产品类型");
				json8.put("value", planResult.get("prodTypeValue"));
				newitemList.add(json8);
				
				JSONObject json9=new JSONObject();
				json9.put("title", "产品类型2");
				json9.put("value", planResult.get("prodType2Value"));
				newitemList.add(json9);
				
				JSONObject json10=new JSONObject();
				json10.put("title", "是否进入冷静期");
				if(planResult.get("isCop")!=null && !"".equals(planResult.get("isCop").toString())){
					if("1".equals(planResult.get("isCop").toString())){
						json10.put("value", "是");
					}else{
						json10.put("value", "否");
					}
				}else{
					json10.put("value", "否");
				}
				newitemList.add(json10);
				
				JSONObject json11=new JSONObject();
				json11.put("title", "是否需要回访");
				if(planResult.get("isReview")!=null && !"".equals(planResult.get("isReview").toString())){
					if("1".equals(planResult.get("isReview").toString())){
						json11.put("value", "是");
					}else{
						json11.put("value", "否");
					}
				}else{
					json11.put("value", "否");
				}
				newitemList.add(json11);
				
				
				JSONObject json24=new JSONObject();
				json24.put("title", "是否面签");
				if(planResult.get("isFacesign")!=null && !"".equals(planResult.get("isFacesign").toString())){
					if("1".equals(planResult.get("isFacesign").toString())){
						json24.put("value", "是");
					}else{
						json24.put("value", "否");
					}
				}else{
					json24.put("value", "否");
				}
				newitemList.add(json24);
				
				JSONObject json25=new JSONObject();
				json25.put("title", "是否在糖罐儿发行");
				if(planResult.get("isTgissue")!=null && !"".equals(planResult.get("isTgissue").toString())){
					if("1".equals(planResult.get("isTgissue").toString())){
						json25.put("value", "是");
					}else{
						json25.put("value", "否");
					}
				}else{
					json25.put("value", "否");
				}
				newitemList.add(json25);
				
				JSONObject json12=new JSONObject();
				json12.put("title", "销售模式");
				if(planResult.get("saleModel")!=null&&!"".equals(planResult.get("saleModel").toString())){
					if("2".equals(planResult.get("saleModel").toString())){
						json12.put("value", "分销");
					}else{
						json12.put("value", "包销");
					}
				}else{
					json12.put("value", "包销");
				}

				newitemList.add(json12);
				
				JSONObject json13=new JSONObject();
				json13.put("title", "销售级别");
				
				if(planResult.get("saleLevel")!=null&&!"".equals(planResult.get("saleLevel").toString())){
					if("2".equals(planResult.get("saleLevel").toString())){
						json13.put("value", "非主力项目");
					}else{
						json13.put("value", "主力项目");
					}
				}else{
					json13.put("value", "主力项目");
				}
				newitemList.add(json13);
				
				JSONObject json14=new JSONObject();
				json14.put("title", "发行额度(万)");
				json14.put("value", planResult.get("issueAmount"));
				newitemList.add(json14);
				
				JSONObject json15=new JSONObject();
				json15.put("title", "最低成立标准(万)");
				json15.put("value", planResult.get("lowMark"));
				newitemList.add(json15);
				
				JSONObject json16=new JSONObject();
				json16.put("title", "发行状态");
				
				if(planResult.get("issuStatus")!=null){
					if("1".equals(planResult.get("issuStatus").toString())){
						json16.put("value", "已设置");
					}else if("2".equals(planResult.get("issuStatus").toString())){
						json16.put("value", "未设置");
					}else if("3".equals(planResult.get("issuStatus").toString())){
						json16.put("value", "未发行");
					}else{
						json16.put("value", "已发行");
					}
				}else{
					json16.put("value", "");
				}
				newitemList.add(json16);
				
				JSONObject json17=new JSONObject();
				json17.put("title", "小额上限");
				json17.put("value", planResult.get("smallUl"));
				newitemList.add(json17);
				
				JSONObject json18=new JSONObject();
				json18.put("title", "预热开始时间");
				json18.put("value", planResult.get("preBegintime"));
				newitemList.add(json18);
				
				JSONObject json19=new JSONObject();
				json19.put("title", "预热结束时间");
				json19.put("value", planResult.get("preEndtime"));
				newitemList.add(json19);
				
				JSONObject json20=new JSONObject();
				json20.put("title", "预计发行时间");
				json20.put("value", planResult.get("issueDate"));
				newitemList.add(json20);
				
				JSONObject json21=new JSONObject();
				json21.put("title", "预计结束时间");
				json21.put("value", planResult.get("endDate"));
				newitemList.add(json21);
				
				JSONObject json22=new JSONObject();
				json22.put("title", "合同寄送时间");
				json22.put("value", planResult.get("contSenddate"));
				newitemList.add(json22);
				
				JSONObject json23=new JSONObject();
				json23.put("title", "募集账号上传时间");
				json23.put("value", planResult.get("fundUpdate"));
				newitemList.add(json23);
				
				JSONObject json26=new JSONObject();
				json26.put("title", "重启预约时间");
				json26.put("value", planResult.get("reaptDate"));
				newitemList.add(json26);			
				
				
				objParam.put("content", newitemList);
				//objParam=planResult;
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品方案获取成功");
			}  else {
	
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}
			
			try {
				remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PRODUCT_OPFEE+"&osFlag="+3,
						CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
						"param=" + newparam, CALL_API_CHARSET);
			} catch (Exception e) {
				e.printStackTrace();
			}
			String str2 = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
			JSONObject opResult = (JSONObject) JSONObject.parse(str2);
			String opCode = opResult.getString("retCode");
			if ("0".equals(opCode)) {
				objParam.put("itemList", opResult.get("itemList"));
				objParam.put("totalNum", opResult.get("totalNum"));
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品方案获取成功");
			}  else {
	
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}
			
		}
			
				

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取产品募集账户
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductAccountInfoApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(newparam, "3");
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_ACCOUNTINFO+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
			JSONArray array=new JSONArray();
			
			JSONObject json1=new JSONObject();
			json1.put("title", "户名");
			json1.put("value", objResult.get("raiseAccname"));
			json1.put("flag", "0");
			array.add(json1);
			
			
			JSONObject json2=new JSONObject();
			json2.put("title", "账号");
			json2.put("value", objResult.get("raiseAccount"));
			json2.put("flag", "1");
			array.add(json2);
			
			JSONObject json3=new JSONObject();
			json3.put("title", "开户行");
			json3.put("value", objResult.get("raiseBank"));
			json3.put("flag", "0");
			array.add(json3);
			
			JSONObject json4=new JSONObject();
			json4.put("title", "大额联行号");
			json4.put("value", objResult.get("payLine"));
			json4.put("flag", "0");
			array.add(json4);
			
//			//募集账户开户行
//			objParam.put("raiseBank", objResult.get("raiseBank"));
//			//募集账户名称
//			objParam.put("raiseAccname", objResult.get("raiseAccname"));
//			//募集账户号
//			objParam.put("raiseAccount", objResult.get("raiseAccount"));
//			//大额联行号
//			objParam.put("payLine", objResult.get("payLine"));
//			String tmp="户名:"+objResult.getString("raiseAccname")+"\n 账号:"+objResult.getString("raiseAccount")+"\n 开户行:"+objResult.getString("raiseBank")+"\n 大额联行号:"+objResult.getString("payLine");
			
			
			callGetProductDetailApi(param,osFlag);
			//无此字段
			//objParam.put("remark", "");
			objParam.put("retCode", "0");
			objParam.put("retMsg", "产品募集账户获取成功");
			
			String omremsg = null;
			try {
				omremsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PRODUCT_REMITMEMO+"&osFlag="+3,
						CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
						"param=" + newparam, CALL_API_CHARSET);
			} catch (Exception e) {
				e.printStackTrace();
			}
			String omstr = ApiCommonUtils.decrypAndSign(omremsg, ApiCommonUtils.APP_CALL_FLAG, "3");
			JSONObject omobjResult = (JSONObject) JSONObject.parse(omstr);
			String omretCode = omobjResult.getString("retCode");
			
			
			

			if ("0".equals(omretCode)) {
				JSONObject json5=new JSONObject();
				json5.put("title", "打款备注");
				json5.put("value", omobjResult.get("remitMemo"));
				json5.put("flag", "0");
				array.add(json5);
				//文字展示
				objParam.put("memo","户名:"+objResult.getString("raiseAccname")+"\n 账号:"+objResult.getString("raiseAccount")+"\n 开户行:"+objResult.getString("raiseBank")+"\n 大额联行号:"+objResult.getString("payLine")+"\n 打款备注:"+omobjResult.get("remitMemo"));
				
				//募集账户开户行
				//objParam.put("remitMemo", omobjResult.get("remitMemo"));
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品募集账户打款备注获取成功");
			}else {
				
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}
			objParam.put("innerList", array);
		}else {
			
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
			
		
				

		return objParam.toString();
	}
	/**
	 * 
	 * TODO 获取产品运营要求
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @return
	 */
	public static String callGetProductOmAskApi(String param,String osFlag) {
		
		//1 解密
		String newparam1 = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//4 加密
		newparam1 = ApiCommonUtils.encrypAndSign(newparam1, "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PRODUCT_PLANID+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam1, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			JSONObject paramJson = new JSONObject();
			paramJson.put("id", objResult.get("issuePlanId"));
			String newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			
			
			try {
				remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PRODUCT_PLAN+"&osFlag="+3,
						CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
						"param=" + newparam, CALL_API_CHARSET);
			} catch (Exception e) {
				e.printStackTrace();
			}
			String str1 = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
			JSONObject planResult = (JSONObject) JSONObject.parse(str1);
			String planCode = planResult.getString("retCode");
			if ("0".equals(planCode)) {
				objParam.put("memo", planResult.get("memo"));
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品运营要求获取成功");
			}  else {
	
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}

		}
			
				

		return objParam.toString();
	}
	
	
	/**
	 * TODO 方法的描述：获取产品合同列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductPactListApi(String param,String osFlag) {
		

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		int rowId=0;
		if(paramJson.get("rowId")!=null && !"".equals(paramJson.get("rowId").toString())){
			//3 将一些默认数据封装到json中
			int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			rowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}else{
			paramJson.put("begNum","0");
			paramJson.put("fetchNum","1000");
		}
		
		paramJson.put("prodId", paramJson.get("prodId"));
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_PACTLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				if(rowId!=0){
					objParam.put("rowId", rowId);
				}
				
				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//材料列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						
						String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
						JSONObject oldobj=JSONObject.parseObject(oldResult);
						String oldCode = oldobj.getString("retCode");
						
						if("0".equals(oldCode)){
							int totalnum=oldobj.getIntValue("totalNum");
							if(totalnum<1){
								JSONObject newjson=new JSONObject();

								newjson.put("httpPath", json.get("httpPath"));
								newjson.put("fileId", json.get("fileId"));
								newjson.put("fileType", json.get("fileType"));
								newjson.put("sourceId", paramJson.get("prodId"));								
								
								//附件服务器地址
								newjson.put("fileServerPath", CTEConstance.getEnvProperty("pmfileServerPath"));
								
								//String fileparam = ApiCommonUtils.encrypAndSign(newjson.toJSONString(), "3");
								
								String fileResult = ApiCommonUtils.excuteOp(newjson.toJSONString(), "fileupload");
								JSONObject fileobj=JSONObject.parseObject(fileResult);
								String fileCode = fileobj.getString("retCode");
								
								if("0".equals(fileCode)){
									

									JSONObject custjson=new JSONObject();
									custjson.put("title", json.get("fileName"));
									custjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("httpPath").replaceAll("uploadFiles", "uploadfiles"));
									
									//获取小图标图片地址
									JSONObject typeObj=new JSONObject();
									typeObj.put("imageType", json.get("fileType"));
									String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
									JSONObject urlobj=JSONObject.parseObject(typeResult);
									custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
									newitemList.add(custjson);
								}else{
									objParam.put("retCode", "-1");
									objParam.put("retMsg", "产品合同列表下载失败");
								}
							}else{
								JSONObject custjson=new JSONObject();
								custjson.put("title", oldobj.get("fileName"));
								custjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath"));
								
								//获取小图标图片地址
								JSONObject typeObj=new JSONObject();
								typeObj.put("imageType", oldobj.get("fileType"));
								String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
								JSONObject urlobj=JSONObject.parseObject(typeResult);
								custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
								newitemList.add(custjson);
							}
						}
						
						
						
					}
					objParam.put("content", newitemList);
				}else{
					objParam.put("content", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品合同列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取产品推荐材料列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProductGroomListApi(String param,String osFlag) {
		

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		int rowId=0;
		if(paramJson.get("rowId")!=null && !"".equals(paramJson.get("rowId").toString())){
			//3 将一些默认数据封装到json中
			int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			rowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}else{
			paramJson.put("begNum", "0");
			paramJson.put("fetchNum", "1000");
		}
		
		paramJson.put("prodId", paramJson.get("prodId"));
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_GROOMLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				if(rowId!=0){
					objParam.put("rowId", rowId);
				}
				
				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//材料列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						
						String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
						JSONObject oldobj=JSONObject.parseObject(oldResult);
						String oldCode = oldobj.getString("retCode");
						
						if("0".equals(oldCode)){
							int totalnum=oldobj.getIntValue("totalNum");
							if(totalnum<1){
								JSONObject newjson=new JSONObject();

								newjson.put("httpPath", json.get("httpPath"));
								newjson.put("fileId", json.get("fileId"));
								newjson.put("fileType", json.get("fileType"));
								newjson.put("sourceId", paramJson.get("prodId"));
								
								
								//附件服务器地址
								newjson.put("fileServerPath", CTEConstance.getEnvProperty("pmfileServerPath"));
								
								//String fileparam = ApiCommonUtils.encrypAndSign(newjson.toJSONString(), "3");
								
								String fileResult = ApiCommonUtils.excuteOp(newjson.toJSONString(), "fileupload");
								JSONObject fileobj=JSONObject.parseObject(fileResult);
								String fileCode = fileobj.getString("retCode");
								
								if("0".equals(fileCode)){
									

									JSONObject custjson=new JSONObject();
									custjson.put("title", json.get("fileName"));
									custjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("httpPath").replaceAll("uploadFiles", "uploadfiles"));
									
									JSONObject typeObj=new JSONObject();
									typeObj.put("imageType", json.get("fileType"));
									String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
									JSONObject urlobj=JSONObject.parseObject(typeResult);
									custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
									newitemList.add(custjson);
								}else{
									objParam.put("retCode", "-1");
									objParam.put("retMsg", "产品合同列表下载失败");
								}
							}else{
								JSONObject custjson=new JSONObject();
								custjson.put("title", oldobj.get("fileName"));
								custjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath"));
								
								//获取小图标图片地址
								JSONObject typeObj=new JSONObject();
								typeObj.put("imageType", oldobj.get("fileType"));
								String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
								JSONObject urlobj=JSONObject.parseObject(typeResult);
								custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
								newitemList.add(custjson);
							}
						}
						
						
						
					}
					objParam.put("content", newitemList);
				}else{
					objParam.put("content", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品推荐材料列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：产品废弃时删除该产品缓存附件信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callProductFileDeleteApi(String param,String osFlag) {
		

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("sourceId", paramJson.get("prodId"));
		if(paramJson.get("type")==null || "".equals(paramJson.get("type").toString())){
			paramJson.put("productType", "");
		}else{
			paramJson.put("productType", paramJson.get("type"));
		}
		
		String fileObj = ApiCommonUtils.excuteOp(paramJson.toJSONString(), "get_fileinfolist_byid");
		JSONObject fileResult=JSONObject.parseObject(fileObj);
		String retCode = fileResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			int totalNum=Integer.parseInt(fileResult.getString("totalNum"));
			if(totalNum!=0){
				//附件列表
				JSONArray arrRespData = (JSONArray)fileResult.get("itemList"); 
				
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					delete(json.getString("filepath"));
				}
			}		
			
			String deleteObj = ApiCommonUtils.excuteOp(paramJson.toJSONString(), "delete_fileinfo_byid");
			JSONObject deleteResult=JSONObject.parseObject(deleteObj);
			String deleteRetCode = deleteResult.getString("retCode");
			
			if("0".equals(deleteRetCode)){
				objParam.put("retCode", "0");
				objParam.put("retMsg", "附件删除成功");
			}else{
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}				
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：产品废弃时删除该产品缓存附件信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callAllProductFileDeleteApi() {
		
		String fileObj = ApiCommonUtils.excuteOp("", "get_allfileinfo");
		JSONObject fileResult=JSONObject.parseObject(fileObj);
		String retCode = fileResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			int totalNum=Integer.parseInt(fileResult.getString("totalNum"));
			if(totalNum!=0){
				//附件列表
				JSONArray arrRespData = (JSONArray)fileResult.get("itemList"); 
				
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					delete(json.getString("filepath"));
				}
			}		
			
			String deleteObj = ApiCommonUtils.excuteOp("", "delete_allfileinfo");
			JSONObject deleteResult=JSONObject.parseObject(deleteObj);
			String deleteRetCode = deleteResult.getString("retCode");
			
			if("0".equals(deleteRetCode)){
				objParam.put("retCode", "0");
				objParam.put("retMsg", "附件删除成功");
			}else{
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}				
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
		return objParam.toString();
	}
	
	 /** 
	  * 删除文件，可以是文件或文件夹 
	  *  
	  * @param fileName 
	  *            要删除的文件名 
	  * @return 删除成功返回true，否则返回false 
	  */  
	 public static boolean delete(String fileName) {  
	  File file = new File(fileName);  
	  if (!file.exists()) {  
	   System.out.println("删除文件失败:" + fileName + "不存在！");  
	   return false;  
	  } else {  
	   if (file.isFile())  
	    return deleteFile(fileName);  
	   else  
	    return deleteDirectory(fileName);  
	  }  
	 } 
	 
	 /** 
	  * 删除单个文件 
	  *  
	  * @param fileName 
	  *            要删除的文件的文件名 
	  * @return 单个文件删除成功返回true，否则返回false 
	  */  
	 public static boolean deleteFile(String fileName) {  
	  File file = new File(fileName);  
	  // 如果文件路径所对应的文件存在，并且是一个文件，则直接删除  
	  if (file.exists() && file.isFile()) {  
	   if (file.delete()) {  
	    System.out.println("删除单个文件" + fileName + "成功！");  
	    return true;  
	   } else {  
	    System.out.println("删除单个文件" + fileName + "失败！");  
	    return false;  
	   }  
	  } else {  
	   System.out.println("删除单个文件失败：" + fileName + "不存在！");  
	   return false;  
	  }  
	 }  
	 
	 /** 
	  * 删除目录及目录下的文件 
	  *  
	  * @param dir 
	  *            要删除的目录的文件路径 
	  * @return 目录删除成功返回true，否则返回false 
	  */  
	 public static boolean deleteDirectory(String dir) {  
	  // 如果dir不以文件分隔符结尾，自动添加文件分隔符  
	  if (!dir.endsWith(File.separator))  
	   dir = dir + File.separator;  
	  File dirFile = new File(dir);  
	  // 如果dir对应的文件不存在，或者不是一个目录，则退出  
	  if ((!dirFile.exists()) || (!dirFile.isDirectory())) {  
	   System.out.println("删除目录失败：" + dir + "不存在！");  
	   return false;  
	  }  
	  boolean flag = true;  
	  // 删除文件夹中的所有文件包括子目录  
	  File[] files = dirFile.listFiles();  
	  for (int i = 0; i < files.length; i++) {  
	   // 删除子文件  
	   if (files[i].isFile()) {  
	    flag = deleteFile(files[i].getAbsolutePath());  
	    if (!flag)  
	     break;  
	   }  
	   // 删除子目录  
	   else if (files[i].isDirectory()) {  
	    flag = deleteDirectory(files[i]  
	      .getAbsolutePath());  
	    if (!flag)  
	     break;  
	   }  
	  }  
	  if (!flag) {  
	   System.out.println("删除目录失败！");  
	   return false;  
	  }  
	  // 删除当前目录  
	  if (dirFile.delete()) {  
	   System.out.println("删除目录" + dir + "成功！");  
	   return true;  
	  } else {  
	   return false;  
	  }  
	 }  
	 
	 /**
		 * TODO 方法的描述：删除订单
		 * 
		 * @param param
		 * @return
		 */
		public static String callDeleteOrderApi(String param,String osFlag) {
			
			
			//1 解密
			String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
			//2 转化为json格式
			JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
			//3 将language默认语言封装到json中
//			paramJson.put("locale", "zh_CN");
//			paramJson.put("id", paramJson.get("orderId"));
			//4 加密
			newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			
//			String remsg = null;
//			try {
//				remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
//						CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//						"param=" + newparam, CALL_API_CHARSET);
//			} catch (Exception e) {
//				e.printStackTrace();
//			}
//			String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
//			JSONObject objResult = (JSONObject) JSONObject.parse(str);
//			String retCode = objResult.getString("retCode");
//			
			
			
			JSONObject objParam = new JSONObject();

//			if ("0".equals(retCode)) {
//				
//					//订单id
//					objParam.put("orderId", objResult.get("id"));
//					//客户姓名
//					objParam.put("investorname", objResult.get("investorname"));
//					//打款金额
//					objParam.put("busiAmount", objResult.get("busiAmount"));
//					//打款金额
//					objParam.put("transferdate", objResult.get("transferdate"));
//					
//					//客户账户id
//					String accountId=objResult.get("accountId").toString();
//					//订单id
//					String busiId=objResult.get("id").toString();
//					
//					String custa="";
//					JSONObject custaJson=new JSONObject();
//					if(accountId == null || "".equals(accountId)){
//						//1新建json
//						JSONObject paramJsonCountid =new JSONObject();
//						//3 将订单id封装到json中
//						paramJsonCountid.put("busiId", busiId);
//						//4 加密
//						String custaparam = ApiCommonUtils.encrypAndSign(paramJsonCountid.toJSONString(), "3");
//						custa=callGetCustaDetailByOrderIdApi(custaparam,"3");
//						custaJson=JSONObject.parseObject(custa);
//					}else{
//						//1新建json
//						JSONObject paramJsonCountid =new JSONObject();
//						//3 将accountId客户账户封装到json中
//						paramJsonCountid.put("accountId", accountId);
//						//4 加密
//						String custaparam = ApiCommonUtils.encrypAndSign(paramJsonCountid.toJSONString(), "3");
//						custa=callGetCustaDetailBycountidApi(custaparam,"3");
//						custaJson=JSONObject.parseObject(custa);
//					}
//					
//					//客户账号
//					objParam.put("customerId", custaJson.get("customerId"));
//					//总行名称
//					objParam.put("hqvalue", custaJson.get("hqvalue"));
//					//分行名称
//					objParam.put("branchValue", custaJson.get("branchValue"));
//					//支行名称
//					objParam.put("accbank", custaJson.get("accbank"));
//					//受益账号
//					objParam.put("acctno", custaJson.get("acctno"));
//					//证件类型
//					objParam.put("certValue", custaJson.get("certValue"));
//					//证件号码
//					objParam.put("certno", custaJson.get("certno"));
//					//客户性质
//					objParam.put("custPropvalue", custaJson.get("custPropvalue"));
//					//销售类型
//					objParam.put("saletypeValue", custaJson.get("saletypeValue"));
//					//手机号码
//					objParam.put("mobile", custaJson.get("mobile"));
//					//通讯地址
//					objParam.put("address", custaJson.get("address"));				
//					
//					objParam.put("retCode", "0");
//					objParam.put("retMsg", "订单详情获取成功");
//			}  else {
//
//				objParam.put("retCode", "-1");
//				objParam.put("retMsg", "处理失败，请联系客服");
//			}
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
			return objParam.toString();
		}
	
	/**
	 * TODO 方法的描述：我的订单列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyOrderListApi(String param,String osFlag) {
		
		//传入参数
		//procId：产品ID
	    //begNum: 开始行号
	    //fetchNum: 结束行号
	    //language: 语言格式

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("language", "zh_CN");
		paramJson.put("flag", "0");
		paramJson.put("cm", paramJson.get("userId"));
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		String orderFlag=paramJson.get("orderFlag").toString();
		if("1".equals(orderFlag)){
			String meetparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			return callGetMyOrderMeetListApi(meetparam,"3");
		}else if("2".equals(orderFlag)){
			//登记中
			paramJson.put("transferstatus", "1,9");
		}else if("3".equals(orderFlag)){
			//确认中
			paramJson.put("transferstatus", "5,8,10,11,12");
		}else if("4".equals(orderFlag)){
			//回访中
			paramJson.put("transferstatus", "13,14,15");
		}else if("5".equals(orderFlag)){
			//已成交
			paramJson.put("transferstatus", "2");
		}else if("6".equals(orderFlag)){
			//已失效
			paramJson.put("transferstatus", "6,16");
		}
		paramJson.remove("orderFlag");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MY_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						//订单编号
						newjson.put("orderId", json.get("id"));
						JSONObject orderJson = new JSONObject();
						orderJson.put("orderId", json.get("id"));
						//糖罐订单编号
						if(json.get("tgOrderNum")!=null &&!"".equals(json.get("tgOrderNum").toString())){
							newjson.put("tgOrderNum", json.get("tgOrderNum"));
						}else{
							newjson.put("tgOrderNum", "");
						}
						
						String orderparam = ApiCommonUtils.encrypAndSign(orderJson.toJSONString(), "3");
						String orderInfo=callGetOrdertDetailApi(orderparam,"3");
						JSONObject order=JSONObject.parseObject(orderInfo);
						
						newjson.put("custMobile", order.get("mobile"));
						
						//产品id
						newjson.put("prodId", json.get("prodId"));
						
						JSONObject prodJson = new JSONObject();
						prodJson.put("id", json.get("prodId"));
						String prodparam = ApiCommonUtils.encrypAndSign(prodJson.toJSONString(), "3");
						String prodInfo=callExcutePmOpApi(prodparam,"3","queryprodetail_returninfo");
						JSONObject prod=JSONObject.parseObject(prodInfo);
						
						JSONObject registerJson = new JSONObject();
						registerJson.put("prdId", prod.get("proCode"));
						String registerparam = ApiCommonUtils.encrypAndSign(registerJson.toJSONString(), "3");
						
						String registerInfo=callGetOrderRegisterInfoApi(registerparam,"3");
						JSONObject register=JSONObject.parseObject(registerInfo);
						
						//产品剩余额度
						newjson.put("remainAmount", register.get("remainAmount"));
						//期限
						newjson.put("termValue", register.get("termValue"));
						
						
						//产品名称
						newjson.put("prodName", json.get("prodname"));
						//订单状态
						newjson.put("transferstatus", json.get("transferstatus"));
						//客户编号
						newjson.put("customerId", json.get("customerId"));
						
						//客户姓名
						newjson.put("custName", json.get("customerName"));
						
						
						
						//客户性质
						newjson.put("custProp", order.get("custProp"));
						//客户性质名称
						newjson.put("custPropvalue", order.get("custPropvalue"));
						if(order.get("custProp")!=null){
							//销售类型代码
							newjson.put("saletype", order.get("saletype"));
							//销售类型
							newjson.put("saletypeValue", order.get("saletypeValue"));
							//客户证件类型
							newjson.put("certtype", order.get("certtype"));
							//客户证件类型名称
							newjson.put("certValue", order.get("certValue"));
							//客户证件号码
							newjson.put("certno", order.get("certno"));
						}else{
							//客户证件类型
							newjson.put("certtype", "");
							//客户证件类型名称
							newjson.put("certValue", "");
							//客户证件号码
							newjson.put("certno", "");
							//销售类型代码
							newjson.put("saletype", "");
							//销售类型
							newjson.put("saletypeValue", "");
						}
						
						
						//打款金额
						newjson.put("regAmount", json.get("busiAmount"));
						newjson.put("regAmountName", json.get("busiAmount")+"万");
						if(json.getString("confirmdate").length()>10){
							//划款时间
							newjson.put("transferdate", json.getString("confirmdate").substring(0, 10));
						}else{
							newjson.put("transferdate", "");
						}
						
						//--------------------------------------------------------------面签-----------------------------------------------
						//是否需要面签1 是 0 否
						String isFaceSign=json.getString("isFaceSign");
						
					    //String isAuthentic=json.getString("isAuthentic");
						
						JSONObject interView=new JSONObject();
						interView.put("label", "面签");

						//面签状态
						String vvstatus=json.get("vvstatus").toString();
						if("1".equals(vvstatus) || "".equals(vvstatus)){
							//是否可以点击 0 否 1 是
							interView.put("buttonFlag", "1");
							interView.put("status", "未预约");
							interView.put("extraInfo", "");
						}else if("2".equals(vvstatus)){
							//是否可以点击
							interView.put("buttonFlag", "1");
							interView.put("status", "待面签");
							interView.put("extraInfo", json.get("orderdate")+" "+json.get("orderbegintime")+"-"+json.get("orderendtime"));
						}else if("3".equals(vvstatus)){
							interView.put("buttonFlag", "0");
							interView.put("status", "面签中");
							interView.put("extraInfo", "");
						}else if("4".equals(vvstatus)){
							interView.put("buttonFlag", "0");
							interView.put("status", "审核中");
							interView.put("extraInfo", "");
						}else if("5".equals(vvstatus)){
							interView.put("buttonFlag", "0");
							interView.put("status", "已完成");
							interView.put("extraInfo", "");
						}else if("6".equals(vvstatus)){
							interView.put("buttonFlag", "1");
							interView.put("status", "待整改");
							interView.put("extraInfo", json.get("vvdemo"));
						}	

						//----------------------------------------------------------------------------------------------------------------------------------------------
						
						//合同审核状态
						newjson.put("upreviewstatus", json.get("upreviewstatus"));//判断合同上传按钮是否显示
						//是否冷静期
						newjson.put("is_cop", json.get("is_cop"));
						//是否续存
						newjson.put("isrenew", json.get("isrenew"));
						//回访驳回
						newjson.put("rvstatus", json.get("rvstatus"));
						
						//面签信息显示
						String  transferstatus=json.get("transferstatus").toString();
						if("1".equals(transferstatus)||"5".equals(transferstatus)||"8".equals(transferstatus)||"10".equals(transferstatus)||"11".equals(transferstatus)||"12".equals(transferstatus)){
							if(!"0".equals(isFaceSign)){
								newjson.put("interView", interView);
							}
						}
						
						//-------------------------------------------------订单按钮begin----------------------------------------------
						//注释:flag值:1 修改 2 划款确认 3 修改划款信息 4 重新划款确认 5 上传合同 6 合同待审核 7 合同通过 8 合同驳回重传 9 修改信息 10 订单详情
						/*
						 *  1 已登记 （修改 、划款确认）
							9 退回（修改）
							5 审核驳回（重新划款确认“无冷静期产品，不续存”）（冷静期产品，续存产品 无按钮）
							8 划款确认中（修改划款信息）
							10 初审通过（左边无，右边待定）
							11 初审驳回（重新划款确认）
							12 冷静期（无按钮）
							13 待回访（无按钮）
							14 回访通过（无按钮）
							15 回访驳回（修改信息）（0，3,4显示)
							2 已成交（订单详情）
							6 已退款（无按钮）
						 * */
						JSONArray buttonList =new JSONArray();
						//1. 判断产品是否有冷静期,如果没有则不用上传合同
						if("1".equals(json.get("is_cop").toString())){
							// 1 已登记 （修改 、划款确认）
							if("1".equals(json.get("transferstatus").toString())){
//								JSONObject button1json=new JSONObject();
//								button1json.put("title", "修改");
//								button1json.put("value", "1");
//								button1json.put("flag","1");
//								buttonList.add(button1json);


								JSONObject button2json=new JSONObject();
								button2json.put("title", "划款确认");
								button2json.put("value",  "2");
								button2json.put("flag",  "1");
								buttonList.add(button2json);
							}
							//9 退回（修改）
							if("9".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "修改");
								button1json.put("value", "1");
								button1json.put("flag","1");
								buttonList.add(button1json);
							}
							//审核驳回（重新划款确认“无冷静期产品，不续存”）（冷静期产品，续存产品 无按钮）
							if("5".equals(json.get("transferstatus").toString())){
								
								//有冷静期而且 合同审核状态为空或2时能上传合同 其他只显示合同状态
								if(json.get("upreviewstatus")==null || "".equals(json.get("upreviewstatus").toString())){
									JSONObject button1json=new JSONObject();
									button1json.put("title", "上传合同");
									button1json.put("value", "5");
									button1json.put("flag","1");
									buttonList.add(button1json);
								}else{
									if("0".equals(json.get("upreviewstatus").toString())){
										JSONObject button1json=new JSONObject();
										button1json.put("title", "合同待审核");
										button1json.put("value", "6");
										button1json.put("flag","0");
										buttonList.add(button1json);
									}
									if("1".equals(json.get("upreviewstatus").toString())){
										JSONObject button1json=new JSONObject();
										button1json.put("title", "合同通过");
										button1json.put("value", "7");
										button1json.put("flag","0");
										buttonList.add(button1json);
									}
									if("2".equals(json.get("upreviewstatus").toString())){
										JSONObject button1json=new JSONObject();
										button1json.put("title", "合同驳回重传");
										button1json.put("value", "8");
										button1json.put("flag","1");
										buttonList.add(button1json);
									}
								}
							}
							// 划款确认中（修改划款信息）
							if("8".equals(json.get("transferstatus").toString())){
								
								JSONObject button1json=new JSONObject();
								button1json.put("title", "修改划款信息");
								button1json.put("value", "3");
								button1json.put("flag","1");
								buttonList.add(button1json);
								
								//有冷静期而且 合同审核状态为空或2时能上传合同 其他只显示合同状态
								if(json.get("upreviewstatus")==null || "".equals(json.get("upreviewstatus").toString())){
									JSONObject button2json=new JSONObject();
									button2json.put("title", "上传合同");
									button2json.put("value", "5");
									button2json.put("flag","1");
									buttonList.add(button2json);
								}else{
									if("0".equals(json.get("upreviewstatus").toString())){
										JSONObject button2json=new JSONObject();
										button2json.put("title", "合同待审核");
										button2json.put("value", "6");
										button2json.put("flag","0");
										buttonList.add(button2json);
									}
									if("1".equals(json.get("upreviewstatus").toString())){
										JSONObject button2json=new JSONObject();
										button2json.put("title", "合同通过");
										button2json.put("value", "7");
										button2json.put("flag","0");
										buttonList.add(button2json);
									}
									if("2".equals(json.get("upreviewstatus").toString())){
										JSONObject button2json=new JSONObject();
										button2json.put("title", "合同驳回重传");
										button2json.put("value", "8");
										button2json.put("flag","1");
										buttonList.add(button2json);
									}
								}
								
							}
							//初审通过（左边无，右边合同状态）
							if("10".equals(json.get("transferstatus").toString())){
								//有冷静期而且 合同审核状态为空或2时能上传合同 其他只显示合同状态
								if(json.get("upreviewstatus")==null || "".equals(json.get("upreviewstatus").toString())){
									JSONObject button1json=new JSONObject();
									button1json.put("title", "上传合同");
									button1json.put("value", "5");
									button1json.put("flag","1");
									buttonList.add(button1json);
								}else{
									if("0".equals(json.get("upreviewstatus").toString())){
										JSONObject button1json=new JSONObject();
										button1json.put("title", "合同待审核");
										button1json.put("value", "6");
										button1json.put("flag","0");
										buttonList.add(button1json);
									}
									if("1".equals(json.get("upreviewstatus").toString())){
										JSONObject button1json=new JSONObject();
										button1json.put("title", "合同通过");
										button1json.put("value", "7");
										button1json.put("flag","0");
										buttonList.add(button1json);
									}
									if("2".equals(json.get("upreviewstatus").toString())){
										JSONObject button1json=new JSONObject();
										button1json.put("title", "合同驳回重传");
										button1json.put("value", "8");
										button1json.put("flag","1");
										buttonList.add(button1json);
									}
								}
							}
							//11 初审驳回（重新划款确认）
							if("11".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "重新划款确认");
								button1json.put("value", "4");
								button1json.put("flag","1");
								buttonList.add(button1json);
								//有冷静期而且 合同审核状态为空或2时能上传合同 其他只显示合同状态
								if(json.get("upreviewstatus")==null || "".equals(json.get("upreviewstatus").toString())){
									JSONObject button2json=new JSONObject();
									button2json.put("title", "上传合同");
									button2json.put("value", "5");
									button2json.put("flag","1");
									buttonList.add(button2json);
								}else{
									if("0".equals(json.get("upreviewstatus").toString())){
										JSONObject button2json=new JSONObject();
										button2json.put("title", "合同待审核");
										button2json.put("value", "6");
										button2json.put("flag","0");
										buttonList.add(button2json);
									}
									if("1".equals(json.get("upreviewstatus").toString())){
										JSONObject button2json=new JSONObject();
										button2json.put("title", "合同通过");
										button2json.put("value", "7");
										button2json.put("flag","0");
										buttonList.add(button2json);
									}
									if("2".equals(json.get("upreviewstatus").toString())){
										JSONObject button2json=new JSONObject();
										button2json.put("title", "合同驳回重传");
										button2json.put("value", "8");
										button2json.put("flag","1");
										buttonList.add(button2json);
									}
								}
							}
							
							//回访驳回（修改信息）（0，3,4显示)
							if("13".equals(json.get("transferstatus").toString())){
								if("3".equals(json.getString("rvstatus")) || "4".equals(json.getString("rvstatus"))){
									JSONObject button1json=new JSONObject();
									button1json.put("title", "修改信息");
									button1json.put("value", "9");
									button1json.put("flag","1");
									buttonList.add(button1json);
								}
								
							}
							//已成交（订单详情）
							if("2".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "订单详情");
								button1json.put("value", "10");
								button1json.put("flag","1");
								buttonList.add(button1json);
							}
							
							//已退款（已失效）
//							if("6".equals(json.get("transferstatus").toString())){
//								JSONObject button1json=new JSONObject();
//								button1json.put("title", "删除");
//								button1json.put("value", "13");
//								button1json.put("flag","1");
//								buttonList.add(button1json);
//							}
						}else{
							if("1".equals(json.get("transferstatus").toString())){
//								JSONObject button1json=new JSONObject();
//								button1json.put("title", "修改");
//								button1json.put("value", "1");
//								button1json.put("flag","1");
//								buttonList.add(button1json);


								JSONObject button2json=new JSONObject();
								button2json.put("title", "划款确认");
								button2json.put("value",  "2");
								button2json.put("flag",  "1");
								buttonList.add(button2json);
							}
							if("9".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "修改");
								button1json.put("value", "1");
								button1json.put("flag","1");
								buttonList.add(button1json);
							}
							if("5".equals(json.get("transferstatus").toString())){
								//无冷静期而且没有续存时显示
								if("0".equals(json.get("isrenew").toString())){
									JSONObject button1json=new JSONObject();
									button1json.put("title", "重新划款确认");
									button1json.put("value", "4");
									button1json.put("flag","1");
									buttonList.add(button1json);
								}
							}
							if("8".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "修改划款信息");
								button1json.put("value", "3");
								button1json.put("flag","1");
								buttonList.add(button1json);
							}
							if("11".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "重新划款确认");
								button1json.put("value", "4");
								button1json.put("flag","1");
								buttonList.add(button1json);
							}
							if("13".equals(json.get("transferstatus").toString())){
								if("3".equals(json.getString("rvstatus")) || "4".equals(json.getString("rvstatus"))){
									JSONObject button1json=new JSONObject();
									button1json.put("title", "修改信息");
									button1json.put("value", "9");
									button1json.put("flag","1");
									buttonList.add(button1json);
								}
							}
							if("2".equals(json.get("transferstatus").toString())){
								JSONObject button1json=new JSONObject();
								button1json.put("title", "订单详情");
								button1json.put("value", "10");
								button1json.put("flag","1");
								buttonList.add(button1json);
							}
							
							//已退款（已失效）
//							if("6".equals(json.get("transferstatus").toString())){
//								JSONObject button1json=new JSONObject();
//								button1json.put("title", "删除");
//								button1json.put("value", "13");
//								button1json.put("flag","1");
//								buttonList.add(button1json);
//							}
						}
						
						
						//-------------------------------------------------订单按钮end----------------------------------------------
						JSONArray orderShow =new JSONArray();
						
						//客户
						JSONObject custjson=new JSONObject();
						custjson.put("title", "客户");
						custjson.put("value",  json.get("customerName"));
						orderShow.add(custjson);
						
						//打款金额
						JSONObject accountjson=new JSONObject();
						accountjson.put("title", "打款金额");
						accountjson.put("value",  json.get("busiAmount").toString()+"万");
						orderShow.add(accountjson);
						
						String a[]=new String[9];
						a[0]=json.get("begindate").toString();
						a[1]=json.get("confirmdate").toString();
						a[2]=json.get("reviewDate").toString();
						a[3]=json.get("upreviewDate").toString();
						a[4]=json.get("uploadDate").toString();
						a[5]=json.get("trialDate").toString();
						a[6]=json.get("rvDate").toString();
						a[7]=json.get("copDate").toString();
						a[8]=json.get("perfdate").toString();
						String updateTime="";
						try {
							updateTime=daysBetween(a);
						} catch (ParseException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
						//预约时间
						newjson.put("regDate", json.get("updateTime"));
						if(!"1".equals(orderFlag) && !"13".equals(json.get("transferstatus").toString())){
//							//显示订单状态
//							newjson.put("transferstatusvalue", json.get("transferstatusvalue"));
							//订单状态
							JSONObject statusjson=new JSONObject();
							statusjson.put("title", "状态");
							statusjson.put("value",  json.get("transferstatusvalue"));
							orderShow.add(statusjson);
						}
						
						if("13".equals(json.get("transferstatus").toString())){
							JSONObject statusjson=new JSONObject();
							statusjson.put("title", "订单状态");
							statusjson.put("value",  json.get("transferstatusvalue"));
							orderShow.add(statusjson);
							
							JSONObject answerjson=new JSONObject();
							answerjson.put("title", "回访状态");
							if(json.get("rvstatus")!=null){
								String rvstatus=json.getString("rvstatus");
								if("0".equals(rvstatus)){
									answerjson.put("value",  "未审核");
								}else if("1".equals(rvstatus)){
									answerjson.put("value",  "审核通过");
								}else if("2".equals(rvstatus)){
									answerjson.put("value",  "审核驳回");
								}else if("3".equals(rvstatus)){
									answerjson.put("value",  "首次驳回");
								}else if("4".equals(rvstatus)){
									answerjson.put("value",  "二次驳回");
								}else{
									answerjson.put("value",  "未审核");
								}
							}else{
								answerjson.put("value",  "未审核");
							}
							orderShow.add(answerjson);
						}
						
						if("11".equals(json.get("transferstatus").toString())){
							JSONObject memojson=new JSONObject();
							memojson.put("title", "备注");
							memojson.put("value",  json.get("trialdemo"));
							orderShow.add(memojson);
						}
						if("5".equals(json.get("transferstatus").toString())){
							JSONObject memojson=new JSONObject();
							memojson.put("title", "备注");
							memojson.put("value",  json.get("rejectreason"));
							orderShow.add(memojson);
						}
						
						//更新时间(待确认updateTime)
						JSONObject upadtejson=new JSONObject();
						upadtejson.put("title", "更新时间");
						upadtejson.put("value",  updateTime);
						orderShow.add(upadtejson);
//						//客户姓名
//						newjson.put("customerName", json.get("customerName"));
//						//打款金额
//						newjson.put("busiAmount", json.get("busiAmount"));
//						//更新时间(时间待确认)
//						newjson.put("updateTime", json.get("confirmdate"));
						
						newjson.put("orderShow", orderShow);
						newjson.put("buttonList", buttonList);
						
						newitemList.add(newjson);
					}
					objParam.put("orderList", newitemList);
				}else{
					objParam.put("orderList", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：我的订单列表(预约中)
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyOrderMeetListApi(String param,String osFlag) {
		

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		String custManagerId=paramJson.get("cm").toString();
		paramJson.put("custManagerId", custManagerId);
		paramJson.remove("cm");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_APPOINT_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);
				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())&& !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						//产品编号
						newjson.put("proCode", json.get("prodCode"));
						//预约订单号(糖罐中)
						newjson.put("orderId", json.get("orderId"));
						
						//****获取登记需要参数******
						JSONObject registerJson = new JSONObject();
						registerJson.put("prdId", json.get("prodCode"));
						String registerparam = ApiCommonUtils.encrypAndSign(registerJson.toJSONString(), "3");
						
						String registerInfo=callGetOrderRegisterInfoApi(registerparam,"3");
						 
						JSONObject registerResultJson=JSONObject.parseObject(registerInfo);
						//产品id
						newjson.put("prodId", registerResultJson.get("id"));
						//产品名称
						newjson.put("prodName", registerResultJson.get("prodName"));
						//期限
						newjson.put("termValue", registerResultJson.get("termValue"));
						//产品总额度
						newjson.put("issueAmount", registerResultJson.get("issueAmount"));
						//产品剩余额度
						newjson.put("remainAmount", registerResultJson.get("remainAmount"));
						//已划小额总数
						newjson.put("smallSum", registerResultJson.get("smallSum"));
						//客户姓名
						newjson.put("custName", json.get("custName"));
						//打款金额
						newjson.put("tradeAmount", json.get("tradeAmount"));
						
						//预约时间
						newjson.put("tradeTime", json.get("updateTime"));
						
						//订单状态
						newjson.put("transferstatus","999");
						
						//糖罐过来的数据暂时定为0（默认身份证）
						newjson.put("certtype",json.get("certType"));
						//证件号码
						newjson.put("certno",json.get("certNo"));
						//客户性质
						newjson.put("custProp",json.get("custProp"));
						
						//订单来源
						newjson.put("busiOrigin",json.get("orderPlatform"));
						
						//客户性质
						//newjson.put("memberId",json.get("memberId"));
						//起投金额
						//newjson.put("lpayLimit", registerResultJson.get("lpayLimit"));
						
						
						//****获取登记需要参数******
						//根据预约订单客户身份证号查询客户ID
						JSONObject cardjson = new JSONObject();
						cardjson.put("idCardNo", json.get("certNo"));
						//加密
						String cardparam = ApiCommonUtils.encrypAndSign(cardjson.toJSONString(), "3");	
						
						String cardInfo=callGetCustomerIdApi(cardparam,"3");
						
						JSONObject cardResultJson=JSONObject.parseObject(cardInfo);
						if("0".equals(cardResultJson.get("retCode").toString())){
							//客户ID(登记判断新老客户用)
							newjson.put("customerId", cardResultJson.get("customerId"));
						}else{
							//客户ID(登记判断新老客户用)
							newjson.put("customerId", "");
						}	
						
						JSONArray orderShow =new JSONArray();
						
						//客户
						JSONObject custjson=new JSONObject();
						custjson.put("title", "客户");
						custjson.put("value",  json.get("custName"));
						orderShow.add(custjson);
						
						//打款金额
						JSONObject accountjson=new JSONObject();
						accountjson.put("title", "打款金额");
						accountjson.put("value",  json.get("tradeAmount").toString()+"万");
						orderShow.add(accountjson);
						
						//剩余名额
						String remainingQuota="";
						if(json.get("remainingQuota")!=null && !"".equals(json.get("remainingQuota").toString())){
							JSONObject quotaJson=new JSONObject();
							quotaJson.put("title", "剩余名额");
							quotaJson.put("value",  json.get("remainingQuota").toString()+"人");
							remainingQuota=json.get("remainingQuota").toString();
							orderShow.add(quotaJson);
						}
						
						
						//更新时间
						JSONObject upadtejson=new JSONObject();
						upadtejson.put("title", "更新时间");
						upadtejson.put("value",  json.get("updateTime"));
						orderShow.add(upadtejson);
						
						
						newjson.put("orderShow", orderShow);
						
						if(json.get("orderType")!=null && "1".equals(json.get("orderType").toString())){
							newjson.put("buttonList", "");
						}else{
							JSONArray buttonList =new JSONArray();
							JSONObject button1json=new JSONObject();
							button1json.put("title", "删除");
							button1json.put("value", "11");
							button1json.put("flag","1");
							buttonList.add(button1json);


							JSONObject button2json=new JSONObject();
							button2json.put("title", "登记");
							button2json.put("value",  "12");
							//剩余名额为0 登记按钮不能点
							if(!"".equals(remainingQuota)&&Integer.parseInt(remainingQuota)==0){
								button2json.put("flag",  "0");
							}else{
								button2json.put("flag",  "1");
							}
							
							buttonList.add(button2json);
							
							newjson.put("buttonList", buttonList);
						}
						
						newitemList.add(newjson);
					}
					objParam.put("orderList", newitemList);
				}else{
					objParam.put("orderList", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：我的订单列表登记所需数据(预约中)
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetOrderRegisterInfoApi(String param,String osFlag) {
		
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_REGISTERINFO+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//产品id
				objParam.put("id", objResult.get("id"));
				//产品名称
				objParam.put("prodName", objResult.get("proName"));
				//产品代码
				objParam.put("proCode", objResult.get("proCode"));
				//期限
				objParam.put("termValue", objResult.get("termValue"));
				//产品总额度
				objParam.put("issueAmount", objResult.get("issueAmount"));
				//产品剩余额度
				objParam.put("remainAmount", objResult.get("remainAmount"));
				//已划小额总数
				objParam.put("smallSum", objResult.get("smallSum"));
				//基准年化收益率
				objParam.put("returnRate", objResult.get("returnRate"));
				//起投金额
				objParam.put("lpayLimit", objResult.get("lpayLimit"));
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "预约中订单扩展信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：我的订单列表登记所需数据(预约中)
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustomerIdApi(String param,String osFlag) {
		
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMERID+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//客户ID
				objParam.put("customerId", objResult.get("customerId"));

				objParam.put("retCode", "0");
				objParam.put("retMsg", "客户ID获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取订单详情
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetOrdertDetailApi(String param,String osFlag) {
		
		//传入参数
		//procId：产品ID
	    //begNum: 开始行号
	    //fetchNum: 结束行号
	    //language: 语言格式
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将language默认语言封装到json中
		paramJson.put("locale", "zh_CN");
		paramJson.put("id", paramJson.get("orderId"));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
				//订单id
				objParam.put("orderId", objResult.get("id"));
				//客户姓名
				objParam.put("investorname", objResult.get("investorname"));
				//打款金额
				objParam.put("busiAmount", objResult.get("busiAmount"));
				//打款金额
				objParam.put("transferdate", objResult.get("transferdate"));
				//划款状态
				objParam.put("transferstatus", objResult.get("transferstatus"));
				//是否提前结算
				objParam.put("isprebalance", objResult.get("isprebalance"));
				//产品名称
				objParam.put("prodName", objResult.get("prodName"));
				
				//面签状态
				objParam.put("vvstatus", objResult.get("vvstatus"));
				
				//客户账户id
				String accountId=objResult.get("accountId").toString();
				//订单id
				String busiId=objResult.get("id").toString();
				
				String custa="";
				JSONObject custaJson=new JSONObject();
				if(accountId == null || "".equals(accountId)){
					//1新建json
					JSONObject paramJsonCountid =new JSONObject();
					//3 将订单id封装到json中
					paramJsonCountid.put("busiId", busiId);
					//4 加密
					String custaparam = ApiCommonUtils.encrypAndSign(paramJsonCountid.toJSONString(), "3");
					custa=callGetCustaDetailByOrderIdApi(custaparam,"3");
					custaJson=JSONObject.parseObject(custa);
					//客户性质
					objParam.put("custProp", custaJson.get("custProp"));
					//证件类型
					objParam.put("certtype", custaJson.get("certtype"));
				}else{
					//1新建json
					JSONObject paramJsonCountid =new JSONObject();
					//3 将accountId客户账户封装到json中
					paramJsonCountid.put("accountId", accountId);
					//4 加密
					String custaparam = ApiCommonUtils.encrypAndSign(paramJsonCountid.toJSONString(), "3");
					custa=callGetCustaDetailBycountidApi(custaparam,"3");
					custaJson=JSONObject.parseObject(custa);
					//客户性质
					objParam.put("custProp", custaJson.get("custProperty"));
					//证件类型
					objParam.put("certtype", custaJson.get("certType"));
				}
				
				//客户账号
				objParam.put("customerId", custaJson.get("customerId"));
				//总行名称
				objParam.put("hqvalue", custaJson.get("hqvalue"));
				//分行名称
				objParam.put("branchValue", custaJson.get("branchValue"));
				//支行名称
				objParam.put("accbank", custaJson.get("accbank"));
				//受益账号
				objParam.put("acctno", custaJson.get("acctno"));
				//证件类型
				objParam.put("certValue", custaJson.get("certValue"));
				//证件号码
				objParam.put("certno", custaJson.get("certno"));
				//客户性质
				objParam.put("custPropvalue", custaJson.get("custPropvalue"));
				//销售类型代码
				objParam.put("saletype", custaJson.get("saletype"));			
				//销售类型
				objParam.put("saletypeValue", custaJson.get("saletypeValue"));
				//手机号码
				objParam.put("mobile", custaJson.get("mobile"));
				//通讯地址
				objParam.put("address", custaJson.get("address"));				
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单详情获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取订单状态
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetOrdertStatusApi(String param,String osFlag) {
		
		//传入参数
		//procId：产品ID
	    //begNum: 开始行号
	    //fetchNum: 结束行号
	    //language: 语言格式
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将language默认语言封装到json中
		paramJson.put("locale", "zh_CN");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
				//订单id
				//objParam.put("id", objResult.get("id"));
				//订单状态
				objParam.put("transferstatus", objResult.get("transferstatus"));
							
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单状态获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：客户账户ID存在时获取客户账户详细信息接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustaDetailBycountidApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将language默认语言封装到json中
		paramJson.put("locale", "zh_CN");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), osFlag);
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTADETAIL_BYCCOUNTID+"&osFlag="+osFlag,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {

				//客户账号
				objParam.put("customerId", objResult.get("accbank").toString()+"("+objResult.get("acctno").toString()+")");
				//总行名称
				objParam.put("hqvalue", objResult.get("hqvalue"));
				//分行名称
				objParam.put("branchValue", objResult.get("branchValue"));
				//支行名称
				objParam.put("accbank", objResult.get("accbank"));
				//受益账号
				objParam.put("acctno", objResult.get("acctno"));
				//证件类型代码
				objParam.put("certType", objResult.get("certType"));
				//证件类型
				objParam.put("certValue", objResult.get("certValue"));
				//证件号码
				objParam.put("certno", objResult.get("certNo"));
				//证件号码
				objParam.put("custProperty", objResult.get("custProperty"));
				//客户性质
				objParam.put("custPropvalue", objResult.get("custPropvalue"));
				//销售类型代码
				objParam.put("saletype", objResult.get("saletype"));
				//销售类型
				objParam.put("saletypeValue", objResult.get("saletypeValue"));
				//手机号码
				objParam.put("mobile", objResult.get("mobile"));
				//通讯地址
				objParam.put("address", objResult.get("address"));

				objParam.put("retCode", "0");
				objParam.put("retMsg", "获取客户账户详细信息成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：客户账户ID不存在时获取客户账户详细信息接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustaDetailByOrderIdApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将language默认语言封装到json中
		paramJson.put("locale", "zh_CN");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), osFlag);
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTADETAIL_BYBUSIID+"&osFlag="+osFlag,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				//客户账号
				objParam.put("customerId", objResult.get("accbank").toString()+"("+objResult.get("acctno").toString()+")");
				objParam.put("acctno", objResult.get("acctno"));
				//是否默认账户
				objParam.put("isdefault", objResult.get("isdefault"));
				//投资人收款账户户名
				objParam.put("acctname", objResult.get("acctname"));
				//备注
				objParam.put("memo", objResult.get("memo"));
				//机构联系人
				objParam.put("orgContact", objResult.get("orgContact"));
				
				
				//获取银行名称
				JSONObject obj = new JSONObject();
//				obj.put("bankid", objResult.get("hqbank"));
				String 	result="";
				JSONObject newobj=new JSONObject();
//				
//				result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_bankname");
//				newobj=JSONObject.parseObject(result);
				objParam.put("hqbank", objResult.get("hqbank"));
//				if("0".equals(newobj.getString("retCode"))){
					//总行名称
					objParam.put("hqvalue", objResult.get("hqbankname"));
//				}else{
//					objParam.put("hqvalue", "");
//					objParam.put("retCode", "1");
//					objParam.put("retMsg", "银行名称获取失败");
//					log.info("retMsg result:银行名称获取失败" + " 参数hqbank:"+objResult.get("hqbank"));
//				}
				
				//获取分行名称
//				obj.put("bankid", objResult.get("branch"));
//				result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_bankname");
//				newobj=JSONObject.parseObject(result);
				objParam.put("branch", objResult.get("branch"));
//				if("0".equals(newobj.getString("retCode"))){
					//总行名称
					objParam.put("branchValue", objResult.get("branchname"));
//				}else{
//					objParam.put("branchValue", "");
//					objParam.put("retCode", "1");
//					objParam.put("retMsg", "分行名称获取失败");
//					log.info("retMsg result:分行名称获取失败" + " 参数bankid:"+objResult.get("branch"));
//				}
				
				//支行名称
				objParam.put("accbank", objResult.get("accbank"));
				//受益账号
				objParam.put("acctno", objResult.get("acctno"));
				
				//获取证件类型
				if("0".equals(objResult.get("custProp").toString())){
					obj.put("categoryname", "个人证件类型");
				}else{
					obj.put("categoryname", "机构证件类型");
				}
				
				obj.put("optionvalue", objResult.get("certType"));
				obj.put("locale", "zh_CN");
				
				result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_optionname");
				newobj=JSONObject.parseObject(result);
				
				if(objResult.get("certType")!=null && !"".equals(objResult.get("certType").toString())){
					objParam.put("certtype", objResult.get("certType"));
					if("0".equals(newobj.getString("retCode"))){
						//证件类型
						objParam.put("certValue", newobj.get("optionname"));
					}else{
						objParam.put("certValue", "");
						objParam.put("retCode", "-1");
						objParam.put("retMsg", "证件类型获取失败");
						log.info("retMsg result:证件类型获取失败" + " 参数certType:"+objResult.get("certType"));
					}
				}else{
					objParam.put("certtype", "");
					objParam.put("certValue", "");
				}
				
				
				
				if(objResult.get("certNo")!=null && !"".equals(objResult.get("certNo").toString())){
					//证件号码
					objParam.put("certno", objResult.get("certNo"));
				}else{
					//证件号码
					objParam.put("certno", "");
				}
				
				if(objResult.get("custProp")!=null && !"".equals( objResult.get("custProp").toString())){
					//获取客户性质
					obj.put("categoryname", "客户性质");
					obj.put("optionvalue", objResult.get("custProp"));
					obj.put("locale", "zh_CN");
					
					result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_optionname");
					newobj=JSONObject.parseObject(result);
					
					objParam.put("custProp", objResult.get("custProp"));
					
					if("0".equals(newobj.getString("retCode"))){
						//客户性质
						objParam.put("custPropvalue", newobj.get("optionname"));
					}else{
						objParam.put("custPropvalue", "");
						objParam.put("retCode", "1");
						objParam.put("retMsg", "客户性质类型获取失败");
						log.info("retMsg result:客户性质类型获取失败" + " 参数custProp:"+objResult.get("custProp"));
					}
				}else{
					objParam.put("custProp", "");
					objParam.put("custPropvalue", "");
				}
				
				
				
				//获取销售类型
				obj.put("categoryname", "销售类型");
				obj.put("optionvalue", objResult.get("saleType"));
				obj.put("locale", "zh_CN");
				
				result = ApiCommonUtils.excuteOp(obj.toString(), "public_get_optionname");
				newobj=JSONObject.parseObject(result);
				
				objParam.put("saletype", objResult.get("saleType"));
				
				if("0".equals(newobj.getString("retCode"))){
					//销售类型
					objParam.put("saletypeValue", newobj.get("optionname"));
				}else{
					objParam.put("saletypeValue", "");
					objParam.put("retCode", "1");
					objParam.put("retMsg", "销售类型获取失败");
					log.info("retMsg result:销售类型获取失败" + " 参数saleType:"+objResult.get("saleType"));
				}
				
				//手机号码
				objParam.put("mobile", objResult.get("mobile"));
				//通讯地址
				objParam.put("address", objResult.get("address"));

				objParam.put("retCode", "0");
				objParam.put("retMsg", "获取客户账户详细信息成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取合同上传类型
	 * 
	 * @param param
	 * @return
	 */
	
	public static String callGetPactTypeListApi(String param,String osFlag) {
		String orderDetail=callGetOrdertDetailApi(param,osFlag);
		JSONObject orderJson = (JSONObject) JSONObject.parse(orderDetail);
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		String prodname=paramJson.get("prodName").toString();
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PACT_PICLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			JSONObject newjson=new JSONObject();
			newjson.put("1", "have");
			newjson.put("2", "have");
			newjson.put("3", "have");
			newjson.put("4", "have");
			newjson.put("5", "have");
			newjson.put("6", "have");
			newjson.put("7", "have");

			if(objResult.get("statusv1List")==null || "".equals(objResult.get("statusv1List").toString())){
				newjson.put("1", "no");
			}
			if(objResult.get("statusv2List")==null || "".equals(objResult.get("statusv2List").toString())){
				newjson.put("2", "no");
			}
			if(objResult.get("statusv3List")==null || "".equals(objResult.get("statusv3List").toString())){
				newjson.put("3", "no");
			}
			if(objResult.get("statusv4List")==null || "".equals(objResult.get("statusv4List").toString())){
				newjson.put("4", "no");
			}
			if(objResult.get("statusv5List")==null || "".equals(objResult.get("statusv5List").toString())){
				newjson.put("5", "no");
			}
			if(objResult.get("statusv6List")==null || "".equals(objResult.get("statusv6List").toString())){
				newjson.put("6", "no");
			}
			if(objResult.get("statusv7List")==null || "".equals(objResult.get("statusv7List").toString())){
				newjson.put("7", "no");
			}
			
			//获取产品id
			JSONObject prodJson = new JSONObject();
			prodJson.put("id", paramJson.get("orderId"));
			String prodparam = ApiCommonUtils.encrypAndSign(prodJson.toJSONString(), "3");
			String prodInfo=callExcuteOpApi(prodparam,"3","order_query_detail");
			JSONObject prod=JSONObject.parseObject(prodInfo);
			String prodId=prod.getString("prodId");
			
			
			
			//获取销售类型
			JSONObject saleJson = new JSONObject();
			saleJson.put("id", prodId);
			String saleparam = ApiCommonUtils.encrypAndSign(saleJson.toJSONString(), "3");
			String saleInfo=callExcutePmOpApi(saleparam,"3","queryprodetail_returninfo");
			JSONObject sale=JSONObject.parseObject(saleInfo);
			String saleType=sale.getString("manageType");
			
			JSONArray orderShow =new JSONArray();
			if(saleType==null || "".equals(saleType.trim()) ||"0".equals(saleType)){//自主(非外采)
				
				JSONObject statusobj=new JSONObject();
				
				//封装7种照片数据
				if(objResult.get("statusv1List") !=null && !"".equals(objResult.get("statusv1List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv1List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv1List", optionAyyay);
				}else{
					statusobj.put("statusv1List", "");
				}		
			 	
			 	if(objResult.get("statusv2List") !=null && !"".equals(objResult.get("statusv2List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv2List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv2List", optionAyyay);
				}else{
					statusobj.put("statusv2List", "");
				}	
			 	
			 	if(objResult.get("statusv3List") !=null && !"".equals(objResult.get("statusv3List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv3List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv3List", optionAyyay);
				}else{
					statusobj.put("statusv3List", "");
				}	
			 	
			 	if(objResult.get("statusv4List") !=null && !"".equals(objResult.get("statusv4List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv4List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv4List", optionAyyay);
				}else{
					statusobj.put("statusv4List", "");
				}	
			 	
			 	if(objResult.get("statusv5List") !=null && !"".equals(objResult.get("statusv5List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv5List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv5List", optionAyyay);
				}else{
					statusobj.put("statusv5List", "");
				}	
			 	
			 	if(objResult.get("statusv6List") !=null && !"".equals(objResult.get("statusv6List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv6List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv6List", optionAyyay);
				}else{
					statusobj.put("statusv6List", "");
				}	
			 	
			 	if(objResult.get("statusv7List") !=null && !"".equals(objResult.get("statusv7List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv7List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv7List", optionAyyay);
				}else{
					statusobj.put("statusv7List", "");
				}	
				
				
				JSONObject json1=new JSONObject();
				json1.put("title", "合格投资者确认书");
				json1.put("value",  "1");
				if("have".equals(newjson.get("1").toString())){
					json1.put("flag",  "1");
				}else{
					json1.put("flag",  "0");
				}
				json1.put("type",  "1");
				//json1.put("acceList",  statusobj.get("statusv1List"));
				orderShow.add(json1);
				
				//打款金额
				JSONObject json2=new JSONObject();
				json2.put("title", "调查问卷");
				json2.put("value", "2");
				if("have".equals(newjson.get("2").toString())){
					json2.put("flag",  "1");
				}else{
					json2.put("flag",  "0");
				}
				json2.put("type",  "1");
				//json2.put("acceList",  statusobj.get("statusv2List"));
				orderShow.add(json2);
				
				//更新时间
				JSONObject json3=new JSONObject();
				json3.put("title", "风险调查");
				json3.put("value",  "3");
				if("have".equals(newjson.get("3").toString())){
					json3.put("flag",  "1");
				}else{
					json3.put("flag",  "0");
				}
				json3.put("type",  "1");
				//json3.put("acceList",  statusobj.get("statusv3List"));
				orderShow.add(json3);
				
				JSONObject json4=new JSONObject();
				json4.put("title", "认购/申购信息表");
				json4.put("value",  "4");
				if("have".equals(newjson.get("4").toString())){
					json4.put("flag",  "1");
				}else{
					json4.put("flag",  "0");
				}
				json4.put("type",  "1");
				//json4.put("acceList",  statusobj.get("statusv4List"));
				orderShow.add(json4);
				
				JSONObject json5=new JSONObject();
				json5.put("title", "合同盖章签字页");
				json5.put("value",  "5");
				if("have".equals(newjson.get("5").toString())){
					json5.put("flag",  "1");
				}else{
					json5.put("flag",  "0");
				}
				json5.put("type",  "1");
				//json5.put("acceList",  statusobj.get("statusv5List"));
				orderShow.add(json5);
				
				JSONObject json6=new JSONObject();
				json6.put("title", "身份证/银行卡/凭条");
				json6.put("value",  "6");
				if("have".equals(newjson.get("6").toString())){
					json6.put("flag",  "1");
				}else{
					json6.put("flag",  "0");
				}
				json6.put("type",  "1");
				//json6.put("acceList",  statusobj.get("statusv6List"));
				orderShow.add(json6);
				
				JSONObject json7=new JSONObject();
				json7.put("title", "资产证明");
				json7.put("value",  "7");
				if(orderJson.get("busiAmount")!=null){
					String regAmount=orderJson.getString("busiAmount");
					if(!"".equals(regAmount)){
						int amount=Integer.parseInt(regAmount);
						if(amount>=300){
							json7.put("type",  "0");
						}else{
							json7.put("type",  "1");
						}
					}else{
						json7.put("type",  "1");
					}
				}else{
					json7.put("type",  "1");
				}
				
				
				
				if("have".equals(newjson.get("7").toString())){
					json7.put("flag",  "1");
				}else{
					json7.put("flag",  "0");
				}
				//json7.put("acceList",  statusobj.get("statusv7List"));
				orderShow.add(json7);
				objParam.put("spFlag", "1");//上传7种类型照片
				
				
				
			}else{//代销(外采)
				JSONObject statusobj=new JSONObject();
				
				//封装7种照片数据
				if(objResult.get("statusv1List") !=null && !"".equals(objResult.get("statusv1List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv1List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv1List", optionAyyay);
				}else{
					statusobj.put("statusv1List", "");
				}		
			 	
			 	if(objResult.get("statusv2List") !=null && !"".equals(objResult.get("statusv2List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv2List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv2List", optionAyyay);
				}else{
					statusobj.put("statusv2List", "");
				}	
			 	
			 	if(objResult.get("statusv3List") !=null && !"".equals(objResult.get("statusv3List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv3List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv3List", optionAyyay);
				}else{
					statusobj.put("statusv3List", "");
				}	
			 	
			 	if(objResult.get("statusv4List") !=null && !"".equals(objResult.get("statusv4List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv4List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv4List", optionAyyay);
				}else{
					statusobj.put("statusv4List", "");
				}	
			 	
			 	if(objResult.get("statusv5List") !=null && !"".equals(objResult.get("statusv5List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv5List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv5List", optionAyyay);
				}else{
					statusobj.put("statusv5List", "");
				}	
			 	
			 	if(objResult.get("statusv6List") !=null && !"".equals(objResult.get("statusv6List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv6List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv6List", optionAyyay);
				}else{
					statusobj.put("statusv6List", "");
				}	
			 	
			 	if(objResult.get("statusv7List") !=null && !"".equals(objResult.get("statusv7List").toString())){
					JSONArray arrOptionData = (JSONArray)objResult.get("statusv7List"); 
					JSONArray optionAyyay=new JSONArray();
					
					//获取状态列表
					for(int i=0;i<arrOptionData.size();i++){
						JSONObject json=(JSONObject)arrOptionData.get(i);
						JSONObject statusjson=new JSONObject();
						
						statusjson.put("primary", json.get("id"));
						statusjson.put("describe", json.get("realpath"));
						
						optionAyyay.add(statusjson);
					}

					statusobj.put("statusv7List", optionAyyay);
				}else{
					statusobj.put("statusv7List", "");
				}	
				
				
				JSONObject json1=new JSONObject();
				json1.put("title", "合格投资者确认书");
				json1.put("value",  "1");
				if("have".equals(newjson.get("1").toString())){
					json1.put("flag",  "1");
				}else{
					json1.put("flag",  "0");
				}
				json1.put("type",  "0");
				//json1.put("acceList",  statusobj.get("statusv1List"));
				orderShow.add(json1);
				
				//打款金额
				JSONObject json2=new JSONObject();
				json2.put("title", "调查问卷");
				json2.put("value", "2");
				if("have".equals(newjson.get("2").toString())){
					json2.put("flag",  "1");
				}else{
					json2.put("flag",  "0");
				}
				json2.put("type",  "0");
				//json2.put("acceList",  statusobj.get("statusv2List"));
				orderShow.add(json2);
				
				//更新时间
				JSONObject json3=new JSONObject();
				json3.put("title", "风险调查");
				json3.put("value",  "3");
				if("have".equals(newjson.get("3").toString())){
					json3.put("flag",  "1");
				}else{
					json3.put("flag",  "0");
				}
				json3.put("type",  "0");
				//json3.put("acceList",  statusobj.get("statusv3List"));
				orderShow.add(json3);
				
				JSONObject json4=new JSONObject();
				json4.put("title", "认购/申购信息表");
				json4.put("value",  "4");
				if("have".equals(newjson.get("4").toString())){
					json4.put("flag",  "1");
				}else{
					json4.put("flag",  "0");
				}
				json4.put("type",  "0");
				//json4.put("acceList",  statusobj.get("statusv4List"));
				orderShow.add(json4);
				
				JSONObject json5=new JSONObject();
				json5.put("title", "合同盖章签字页");
				json5.put("value",  "5");
				if("have".equals(newjson.get("5").toString())){
					json5.put("flag",  "1");
				}else{
					json5.put("flag",  "0");
				}
				json5.put("type",  "0");
				//json5.put("acceList",  statusobj.get("statusv5List"));
				orderShow.add(json5);
				
				JSONObject json6=new JSONObject();
				json6.put("title", "身份证/银行卡/凭条");
				json6.put("value",  "6");
				if("have".equals(newjson.get("6").toString())){
					json6.put("flag",  "1");
				}else{
					json6.put("flag",  "0");
				}
				json6.put("type",  "1");
				//json6.put("acceList",  statusobj.get("statusv6List"));
				orderShow.add(json6);
				
				JSONObject json7=new JSONObject();
				json7.put("title", "资产证明");
				json7.put("value",  "7");
				json7.put("type",  "1");				
				
				if("have".equals(newjson.get("7").toString())){
					json7.put("flag",  "1");
				}else{
					json7.put("flag",  "0");
				}
				//json7.put("acceList",  statusobj.get("statusv7List"));
				orderShow.add(json7);
				objParam.put("spFlag", "0");//1种类型照片必传
				
			}
			
		 	objParam.put("content", orderShow);
		 	
		 	objParam.put("orderId", paramJson.get("orderId"));//订单编号
		 	
		 	
		 	

		 	
		 	
			objParam.put("retCode", "0");
			objParam.put("retMsg", "合同类型列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取凭条照片列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetProofPicListApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(newparam, "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PROOF_PICLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					
					newjson.put("filetype", json.get("filetype"));
					newjson.put("fileurl", OMAPI_ROOT+json.get("fileurl").toString());
					optionAyyay.add(newjson);
				}

				objParam.put("picList", optionAyyay);
			}else{
				objParam.put("picList", "");
			}
				
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "凭证照片列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取凭条照片列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetPactPicListApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 加密
		newparam = ApiCommonUtils.encrypAndSign(newparam, "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PACT_PICLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					
					newjson.put("filetype", json.get("filetype"));
					newjson.put("fileurl", OMAPI_ROOT+json.get("fileurl").toString());
					optionAyyay.add(newjson);
				}

				objParam.put("picList", optionAyyay);
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "凭证照片列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：调用产品平台公共接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callExcutePmOpApi(String param,String osFlag,String opName) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		int newrowId=0;
		if(paramJson.get("rowId")!=null){
			int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			newrowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}
		paramJson.put("cm", paramJson.get("userId"));
		paramJson.put("memo", "");
		paramJson.put("managerId", paramJson.get("userId"));
		paramJson.put("locale", "zh_CN");
		paramJson.put("language", "zh_CN");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		if ("0".equals(retCode)) {
			if(newrowId!=0){
				//开始行号
				objResult.put("rowId", newrowId);
			}
			objResult.put("retCode", "0");
			objResult.put("retMsg", "操作成功");
			objResult.remove("_userId");
			objResult.remove("begNum");
			objResult.remove("fetchNum");
			objResult.remove("locale");
			objResult.remove("language");
		}  else {

		objResult.put("retCode", "-1");
		objResult.put("retMsg", "处理失败，请联系客服");
	}


		return objResult.toString();
	}
	/**
	 * TODO 方法的描述：模糊查询经办人列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetAgentListApi(String param,String osFlag) {

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		int newrowId=0;
		if(paramJson.get("rowId")!=null&&!"".equals(paramJson.get("rowId").toString())){
			int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			newrowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}else{
			paramJson.put("begNum", Integer.toString(1));
			paramJson.put("fetchNum", "");
		}
		paramJson.put("busiId", paramJson.get("orderId"));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_AGENT_List+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				if(newrowId!=0){
					//开始行号
					objResult.put("rowId", newrowId);
				}
				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())&& !"0".equals(objResult.get("totalNum").toString())){
					//产品列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						//产品id
						newjson.put("primary", json.get("id"));
						//产品名称
						newjson.put("branchname", json.get("branchname"));
						//产品编码
						newjson.put("username", json.get("username"));
						newitemList.add(newjson);
					}
					objParam.put("itemList", newitemList);
				}else{
					objParam.put("itemList", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "经办人列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：模糊查询经办人列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callOrderAcceDeleteApi(String param,String osFlag) {

		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		JSONObject inParam = new JSONObject();
		if(paramJson.get("acceList") !=null && !"".equals(paramJson.get("acceList").toString())){
			//产品列表
			JSONArray arrRespData = (JSONArray)paramJson.get("acceList"); 

			List<JSONObject> newitemList=new ArrayList<JSONObject>();
			for(int i=0;i<arrRespData.size();i++){
				JSONObject json=(JSONObject)arrRespData.get(i);
				JSONObject newjson=new JSONObject();
				//附件id
				newjson.put("id", json.get("primary"));
				//附件存储地址
				newjson.put("realpath", json.get("describe"));

				newitemList.add(newjson);
			}
			inParam.put("acceList", newitemList);
		}else{
			inParam.put("acceList", "");
		}
		
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(inParam.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + ORDER_ACCE_DELETE+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//解密
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "合同附件删除成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：调用运营平台公共接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callExcuteOpApi(String param,String osFlag,String opName) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		int newrowId=0;
		if("order_acce_query_agentlist".equals(opName)){
			if(paramJson.get("rowId")!=null&&!"".equals(paramJson.get("rowId").toString())){
				int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
				if(begNum==0){
					begNum=1;
				}
				int fetchNum = Integer.parseInt(pageNum);
				newrowId = begNum+Integer.parseInt(pageNum);
				paramJson.put("begNum", Integer.toString(begNum));
				paramJson.put("fetchNum", Integer.toString(fetchNum));
			}else{
				paramJson.put("begNum", Integer.toString(1));
				paramJson.put("fetchNum", "");
			}
		}else{
			//3 将一些默认数据封装到json中
			
			if(paramJson.get("rowId")!=null&&!"".equals(paramJson.get("rowId").toString())){
				int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
				if(begNum==0){
					begNum=1;
				}
				int fetchNum = Integer.parseInt(pageNum);
				newrowId = begNum+Integer.parseInt(pageNum);
				paramJson.put("begNum", Integer.toString(begNum));
				paramJson.put("fetchNum", Integer.toString(fetchNum));
			}else{
				paramJson.put("begNum", Integer.toString(1));
				paramJson.put("fetchNum", "");
			}
		}
		
		
		paramJson.put("cm", paramJson.get("userId"));
		paramJson.put("memo", "");
		paramJson.put("managerId", paramJson.get("userId"));
		paramJson.put("locale", "zh_CN");
		paramJson.put("language", "zh_CN");
		if("order_retvisit_retryvisit".equals(opName) || "order_acce_cop_end".equals(opName)){
			paramJson.put("busiId", paramJson.get("orderId")); 
		}
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		String flag="3";
//		if("order_acce_upload".equals(opName)){
//			newparam=param;
//			flag=osFlag;
//		}
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		if ("0".equals(retCode)) {
			if(newrowId!=0){
				//开始行号
				objResult.put("rowId", newrowId);
			}
			if("order_custaccountid_detail".equals(opName)){
//				objResult.put("custProp", objResult.get("custProperty"));
//				objResult.remove("custProperty");
			}
			
			if("order_acce_upload".equals(opName)){
				JSONObject acceResult =new JSONObject();
				acceResult.put("retCode", "0");
				acceResult.put("retMsg", "附件上传成功");
				return acceResult.toString();
			}
			if("order_custaccountid_detail".equals(opName)){
				objResult.put("custProp", objResult.get("custProperty"));
				objResult.remove("custProperty");
				objResult.put("orgContact", objResult.get("orgcontact"));
				objResult.remove("orgcontact");
				objResult.put("certtype", objResult.get("certType"));
				objResult.remove("certType");
				objResult.put("certno", objResult.get("certNo"));
				objResult.remove("certNo");
			}
			
			objResult.put("retCode", "0");
			objResult.put("retMsg", "操作成功");
			objResult.remove("_userId");
			objResult.remove("begNum");
			objResult.remove("fetchNum");
			objResult.remove("locale");
			objResult.remove("language");
		}  else {

		objResult.put("retCode", "-1");
		objResult.put("retMsg", "处理失败，请联系客服");
	}
		if("order_retvisit_retryvisit".equals(opName)){
			if("-2".equals(retCode)){
				objResult.put("retCode", "-2");
				objResult.put("retMsg", "不允许再做回访");
			}
		}


		return objResult.toString();
	}
	
	/**
	 * TODO 方法的描述：调用运营平台公共接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callExcuteOpFileApi(String param,String osFlag,String opName,InputStream file) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		//paramJson.put("flag", osFlag);
		
//		BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(file));  
//		  
//        StringBuffer tStringBuffer = new StringBuffer();  
//
//        String sTempOneLine = new String("");  
//
//        try {
//			while ((sTempOneLine = tBufferedReader.readLine()) != null){  
//
//			    tStringBuffer.append(sTempOneLine);  
//
//			}
//		} catch (IOException e1) {
//			// TODO Auto-generated catch block
//			e1.printStackTrace();
//		}  
		
		byte[] data=null;
		try {
			data = new byte[file.available()];
			file.read(data);
			file.close();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		// 对字节数组Base64编码
		BASE64Encoder encoder = new BASE64Encoder();
		
		
		paramJson.put("fileList", encoder.encode(data));
		System.out.println(encoder.encode(data));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");

		
		String remsg = null;
		//
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+"order_acce_upload&osFlag="+3+"&flag="+osFlag,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		if ("0".equals(retCode)) {		
			objResult.put("retCode", "0");
			objResult.put("retMsg", "操作成功");
			objResult.remove("_userId");
			objResult.remove("begNum");
			objResult.remove("fetchNum");
			objResult.remove("locale");
			objResult.remove("language");
		}  else {

		objResult.put("retCode", "-1");
		objResult.put("retMsg", "处理失败，请联系客服");
	}
		if("order_retvisit_retryvisit".equals(opName)){
			if("-2".equals(retCode)){
				objResult.put("retCode", "-2");
				objResult.put("retMsg", "不允许再做回访");
			}
		}


		return objResult.toString();
	}
	
	/**
	 * TODO 方法的描述：修改已登记与退回状态订单接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callOrderUpdateApi(String param,String osFlag,String opName) {
		
		String orderparam=callGetOrdertDetailApi(param,osFlag); 
		JSONObject orderJson = (JSONObject) JSONObject.parse(orderparam);
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		
		//3 将一些默认数据封装到json中
		
		paramJson.put("id", paramJson.get("orderId"));
		//客户来源
		paramJson.put("custOrig", "");
		//是否提前结算
		paramJson.put("isprebalance", orderJson.get("isprebalance"));
		//订单状态
		paramJson.put("transferstatus", orderJson.get("transferstatus"));
		//备注
		paramJson.put("memo", orderJson.get("memo"));
		//登记金额
		paramJson.put("busiAmount", paramJson.get("regAmount"));
		
		paramJson.put("managerId", paramJson.get("userId"));
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "订单登记修改成功，请到登记中查看！");
		}else if("-3".equals(retCode)){
			objParam.put("retCode", "-3");
			objParam.put("retMsg", "超出发行额度");
		}else if("-4".equals(retCode)){
			objParam.put("retCode", "-4");
			objParam.put("retMsg", "小额达到上限");
		}else if("-5".equals(retCode)){
			objParam.put("retCode", "-5");
			objParam.put("retMsg", "唐诚成交后不允许退款");
		}else if("-6".equals(retCode)){
			objParam.put("retCode", "-6");
			objParam.put("retMsg", "未达到起投金额");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "数据库异常");
		}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：查询客户经理的客户列表接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustListApi(String param,String osFlag,String opName) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		//3 将一些默认数据封装到json中
		int newrowId=0;
		if(paramJson.get("rowId")!=null && !"".equals(paramJson.get("rowId").toString())){
			int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			newrowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}else{
			paramJson.put("begNum", Integer.toString(1));
			paramJson.put("fetchNum", "");
		}
		//客户性质
		paramJson.put("customerProperty", paramJson.get("custprop"));
		paramJson.put("cm", paramJson.get("userId"));
		paramJson.put("locale", "zh_CN");

		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("totalNum", objResult.getString("totalNum"));
			//分页标识
			if(newrowId !=0){
				objParam.put("rowId", newrowId);
			}
			
			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString()) || "0".equals(objResult.get("totalNum").toString())){
				objParam.put("itemList", "");		
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//客户id
					newjson.put("customerId", json.get("id"));
					//客户名字
					newjson.put("custname", json.get("investorname"));			
					//客户电话
					newjson.put("mobile", json.get("mobile"));
					
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);		
			}
				
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "客户列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：根据产品名称或产品编码模糊查询产品列表接口
	 * 
	 * @param param
	 * @return
	 * @throws ParseException 
	 */
	public static String callFuzyyProductListApi(String param,String osFlag,String opName) throws ParseException {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		
		//3 将一些默认数据封装到json中		
		int newrowId=0;
		if(paramJson.get("rowId")!=null && !"".equals(paramJson.get("rowId").toString())){
			int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			newrowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}else{
			paramJson.put("begNum", Integer.toString(1));
			paramJson.put("fetchNum", "");
		}
		
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("totalNum", objResult.getString("totalNum"));
			if(newrowId!=0){
				objParam.put("rowId", newrowId);
			}
			
			if(objResult.get("itemList")==null || "".equals(objResult.get("itemList").toString()) || "0".equals(objResult.get("totalNum").toString())){
				objParam.put("itemList", "");
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//产品id
					newjson.put("prodId", json.get("id"));
					//产品名称
					newjson.put("prodName", json.get("proName"));
					//产品编码
					newjson.put("proCode", json.get("proCode"));
					//剩余额度
					newjson.put("remainAmount", json.get("remainamount"));
					//期限
					newjson.put("termValue", json.get("termValue"));
					//是否允许登记新客户（1是0否）
					newjson.put("isallowdjxkh", json.get("isallowdjxkh"));
					String issueDate=null;
					String reaptDate=null;
					String tmpDate=null;
					if(json.get("issueDate")!=null && !"".equals(json.get("issueDate"))){
						//发行时间
						issueDate =json.getString("issueDate");
					}
					
					if(json.get("reaptDate")!=null && !"".equals(json.get("reaptDate"))){
						//重新预约时间
						reaptDate  =json.getString("reaptDate");
					}  
					
					if(issueDate!=null && reaptDate==null){
						tmpDate=issueDate;
					}else if(issueDate==null && reaptDate!=null){
						tmpDate=reaptDate;
					}else if(issueDate!=null && reaptDate!=null){
						String a[]=new String[2];
						a[0]=issueDate;
						a[1]=reaptDate;
						tmpDate=daysBetween(a);
					}
					
					if(tmpDate!=null){
						SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
						sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
						String time= sdf.format(new Date());

						log.info("当前服务器时间为：" + time);
						
						int value=compare_date(time,tmpDate);
						
						log.info("时间比对结果为：" + value);
						log.info("被过滤掉的产品为：proName：" + json.get("proName")+"prodId:"+json.get("id"));
						if(value<1){
							continue;
						}
						
					}
					
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);	
			}
			
					

			objParam.put("retCode", "0");
			objParam.put("retMsg", "产品列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：订单登记接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callOrderRegisterApi(String param,String osFlag,String opName) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
//		if(paramJson.get("custprop") ==null || "".equals(paramJson.get("custprop").toString())){
//			JSONObject custParam = new JSONObject();
//			custParam.put("retCode", "-99");
//			custParam.put("retMsg", "该版本暂不支持个人新客户登记，请新客户先至糖罐儿预约！");
//			return custParam.toString();
//		}
		
		if(paramJson.get("orderId") !=null && !"".equals(paramJson.get("orderId").toString())){
			return callOrderUpdateApi(param,osFlag,"order_register_update");
		}
		
		if(paramJson.get("ordersNo") !=null && !"".equals(paramJson.get("ordersNo").toString())){
			//修改糖罐订单状态
			paramJson.put("orderId", paramJson.getString("ordersNo"));
			paramJson.put("setStatus", "1");
			String meetparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			String meet=updateRegistStatus(meetparam,"3"); 
			JSONObject meetResult = (JSONObject) JSONObject.parse(meet);
			String meetCode = meetResult.getString("retCode");
			if(!"0".equals(meetCode)){
				JSONObject meetParam = new JSONObject();
				meetParam.put("retCode", "-1");
				meetParam.put("retMsg", "处理失败，请联系客服");
				return meetParam.toString();
			}
		}
		
		//3 将一些默认数据封装到json中

		paramJson.put("cm", paramJson.get("userId"));
		paramJson.put("memo", "");
		paramJson.put("managerId", paramJson.get("userId"));
		paramJson.put("tgOrderNo", paramJson.get("ordersNo"));
		
		if(paramJson.get("user")==null || "".equals(paramJson.get("user").toString())){
			paramJson.put("user", paramJson.get("userId"));
		}
		
		if(paramJson.get("regDate")==null || "".equals(paramJson.get("regDate").toString())){
			SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
			paramJson.put("regDate", df.format(new Date()));
		}

		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "订单登记成功，请到登记中查看！");
		}else if("-2".equals(retCode)){
			objParam.put("retCode", "-2");
			objParam.put("retMsg", "数据库异常");
		}else if("-3".equals(retCode)){
			objParam.put("retCode", "-3");
			objParam.put("retMsg", "超出发行额度");
		}else if("-4".equals(retCode)){
			objParam.put("retCode", "-4");
			objParam.put("retMsg", "小额达到上限");
		}else if("-5".equals(retCode)){
			objParam.put("retCode", "-5");
			objParam.put("retMsg", "未达到起投金额");
		}else if("-6".equals(retCode)){
			objParam.put("retCode", "-6");
			objParam.put("retMsg", "该糖罐儿预约订单已经被登记");
		}else if("-7".equals(retCode)){
			objParam.put("retCode", "-7");
			objParam.put("retMsg", "财富师冻结注销状态不能登记");
		}else if("-8".equals(retCode)){
			objParam.put("retCode", "-8");
			objParam.put("retMsg", "停止预约产品");
		}else if("-9".equals(retCode)){
			objParam.put("retCode", "-9");
			objParam.put("retMsg", "该产品已募集结束");
		}else if("-10".equals(retCode)){
			objParam.put("retCode", "-10");
			objParam.put("retMsg", "您好，此产品已无剩余名额，暂不能登记");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
		if(!"0".equals(retCode)){
			if(paramJson.get("ordersNo") !=null && !"".equals(paramJson.get("ordersNo").toString())){
				//修改糖罐订单状态
				paramJson.put("orderId", paramJson.getString("ordersNo"));
				paramJson.put("setStatus", "0");
				String meetparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
				updateRegistStatus(meetparam,"3"); 
			}
		}
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：修改糖罐中预约订单状态
	 * 
	 * @param param
	 * @return
	 */
	public static String updateRegistStatus(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//4 加密
		String inparam = ApiCommonUtils.encrypAndSign(newparam, "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + UPDATE_APPOINT_STATUS+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + inparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "糖罐中预约订单状态变更成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：删除预约中订单
	 * 
	 * @param param
	 * @return
	 */
	public static String deleteRegistStatus(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("orderId", paramJson.get("ordersNo"));
		//4 加密
		String inparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + DELETE_APPOINT_ORDER+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + inparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "糖罐中预约订单删除成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：划款确认获取客户账户列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustCountListApi(String param,String osFlag,String opName) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("customer", paramJson.get("customerId"));	
		paramJson.put("locale", "zh_CN");

		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			
			if(objResult.get("itemList")==null || "".equals(objResult.get("itemList").toString())){
				objParam.put("itemList", "");	
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					
					
					JSONObject newjson=new JSONObject();
					//客户账户id
					newjson.put("accountId", json.get("id"));
					//客户账号
					newjson.put("acctno", json.get("Acctno"));
					//客户账户户名
					newjson.put("acctname", json.get("Acctname"));
					
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);	
			}
			
					
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "客户账户列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：划款确认获取总行,分行,证件类型,客户性质,销售类型列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetBankListApi(String param,String osFlag,String opName) {
		
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson =new JSONObject();
		if(newparam !=null && !"".equals(newparam)){
			//2 转化为json格式
			paramJson = (JSONObject) JSONObject.parse(newparam);
			if(paramJson!=null){
				//3 将一些默认数据封装到json中
				if("order_transfer_query_certtypelist".equals(opName)){
					if(paramJson.containsKey("custprop")){
						paramJson.put("certType", paramJson.get("custprop"));
					}else{
						paramJson.put("certType", "");
					}			
				}	
			}
		}else{
			paramJson.put("certType", "");
		}
		
				
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			
			if(objResult.get("itemList")==null || "".equals(objResult.get("itemList").toString())){
				objParam.put("itemList", "");
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					
					
					JSONObject newjson=new JSONObject();
					
					
					//总行
					if("order_query_hqbank".equals(opName) || "order_query_branchbank".equals(opName)){
						//总行id
						newjson.put("primary", json.get("id"));
						//总行名称
						newjson.put("value", json.get("name"));
					}else if("order_transfer_query_certtypelist".equals(opName)){
						newjson.put("primary", json.get("optionValue"));
						newjson.put("value", json.get("optionName"));
						newjson.put("custType", json.get("certtype"));
					}else{
						newjson.put("primary", json.get("optionValue"));
						newjson.put("value", json.get("optionName"));
					}
//					
//					//分行
//					if("order_query_branchbank".equals(opName)){
//						//分行id
//						newjson.put("branch", json.get("id"));
//						//分行名称
//						newjson.put("branchvalue", json.get("name"));
//					}
//					
//					//证件类型
//					if("order_transfer_query_certtypelist".equals(opName)){
//						//证件类型编号
//						newjson.put("certtype", json.get("optionValue"));
//						//证件类型值
//						newjson.put("certvalue", json.get("optionName"));
//					}
//					
//					//客户性质
//					if("order_transfer_query_custproplist".equals(opName)){
//						//客户性质编号
//						newjson.put("custProp", json.get("optionValue"));
//						//客户性质
//						newjson.put("custPropvalue", json.get("optionName"));
//					}
//					
//					//销售类型
//					if("order_transfer_query_saletypelist".equals(opName)){
//						//销售类型编号
//						newjson.put("saletype", json.get("optionValue"));
//						//销售类型
//						newjson.put("saletypeValue", json.get("optionName"));
//					}
					
					
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);	
			}
			
					
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "信息获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	
	/**
	 * TODO 方法的描述：划款确认提交接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callOrderTransferApi(String param,String osFlag,String opName) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("id", paramJson.get("orderId"));

		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String tmp=ApiCommonUtils.decrypAndSign(newparam, ApiCommonUtils.APP_CALL_FLAG, "3");
		
		String check=callcheckOrderTransferDataApi(paramJson.toJSONString(),"3");
		JSONObject checkJson = (JSONObject) JSONObject.parse(check);
		String checkCode = checkJson.getString("retCode");
		JSONObject objParam = new JSONObject();
		if("0".equals(checkCode)){
			String remsg = null;
			try {
				remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
						CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
						"param=" + newparam, CALL_API_CHARSET);
			} catch (Exception e) {
				e.printStackTrace();
			}
			String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
			JSONObject objResult = (JSONObject) JSONObject.parse(str);
			String retCode = objResult.getString("retCode");
			
			if ("0".equals(retCode)) {
				objParam.put("retCode", "0");
				objParam.put("retMsg", "划款确认成功");
			}else if("-1".equals(retCode)){
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "数据库异常");
			}else if("-2".equals(retCode)){
				objParam.put("retCode", "-2");
				objParam.put("retMsg", "客户账号信息已存在");
			}else if("-3".equals(retCode)){
				objParam.put("retCode", "-3");
				objParam.put("retMsg", "投资人银行账号未填");
			}else if("-4".equals(retCode)){
				objParam.put("retCode", "-4");
				objParam.put("retMsg", "被别的客户经理绑定的老客户");
			}else if("-5".equals(retCode)){
				objParam.put("retCode", "-5");
				objParam.put("retMsg", "客户名称或证件号与系统不一致");
			}else if("-6".equals(retCode)){
				objParam.put("retCode", "-6");
				objParam.put("retMsg", "续存审核驳回的不允许提交");
			}else if("-7".equals(retCode)){
				objParam.put("retCode", "-7");
				objParam.put("retMsg", "机构用户需填写机构联系人！");
			}else{
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}
		}else if("-7".equals(checkCode)){
			objParam.put("retCode", "-8");
			objParam.put("retMsg", "证件类型和客户性质不匹配");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：划款确认前校验证件类型
	 * 
	 * @param param
	 * @return
	 */
	public static String callcheckOrderTransferDataApi(String param,String osFlag) {
		
		
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(param);
		String custProp=paramJson.getString("custProp");
		String certtype=paramJson.getString("certtype");
		String custType="";
		
		String newparam = ApiCommonUtils.encrypAndSign("", "3");
		String result =callGetBankListApi(newparam,osFlag,"order_transfer_query_certtypelist");
		JSONObject objResult = (JSONObject) JSONObject.parse(result);
		String retCode = objResult.getString("retCode");
		
		
		JSONObject objParam = new JSONObject();
		if ("0".equals(retCode)) {
			if(objResult.get("itemList")==null || "".equals(objResult.get("itemList").toString())){
				objParam.put("itemList", "");
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);				
					if(certtype.equals(json.get("primary").toString())){
						custType=json.get("custType").toString();
					}
				}
				
				if(custProp.equals(custType)){
					objParam.put("retCode", "0");
					objParam.put("retMsg", "验证通过");
				}else{
					objParam.put("retCode", "-7");
					objParam.put("retMsg", "证件类型和客户性质不匹配");
				}
			}
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：划款确认修改
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetOrderAccountUpateDetailApi(String param,String osFlag) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将language默认语言封装到json中
		paramJson.put("locale", "zh_CN");
		paramJson.put("id", paramJson.get("orderId"));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject custaJson=new JSONObject();

		if ("0".equals(retCode)) {
			//客户账户id
			String accountId=objResult.get("accountId").toString();
			//订单id
			String busiId=objResult.get("id").toString();
			
			String custa="";
			
			if(accountId == null || "".equals(accountId)){
				//1新建json
				JSONObject paramJsonCountid =new JSONObject();
				//3 将订单id封装到json中
				paramJsonCountid.put("busiId", busiId);
				//4 加密
				String custaparam = ApiCommonUtils.encrypAndSign(paramJsonCountid.toJSONString(), "3");
				custa=callGetCustaDetailByOrderIdApi(custaparam,"3");
				custaJson=JSONObject.parseObject(custa);
				//订单id
				custaJson.put("orderId", objResult.get("id"));
				//客户姓名
				custaJson.put("customerName", objResult.get("investorname"));
				//打款金额
				custaJson.put("busiAmount", objResult.get("busiAmount"));
				//客户id判断新老客户用
				custaJson.put("customerId", objResult.get("customerId"));
				
				//客户id判断客户有没有账户
				custaJson.put("accountId", "");
				//划款日期
				custaJson.put("transferdate", objResult.get("transferdate"));
				
			}else{
				//1新建json
				JSONObject paramJsonCountid =new JSONObject();
				//3 将accountId客户账户封装到json中
				paramJsonCountid.put("accountId", accountId);
				//4 加密
				String custaparam = ApiCommonUtils.encrypAndSign(paramJsonCountid.toJSONString(), "3");
				custa=callExcuteOpApi(custaparam,"3","order_custaccountid_detail");
				custaJson=JSONObject.parseObject(custa);
				//订单id
				custaJson.put("orderId", objResult.get("id"));
				//客户姓名
				custaJson.put("customerName", objResult.get("investorname"));
				//打款金额
				custaJson.put("busiAmount", objResult.get("busiAmount"));
				//客户id判断新老客户用
				custaJson.put("customerId", objResult.get("customerId"));
				//划款日期
				custaJson.put("transferdate", objResult.get("transferdate"));
				
			}		
			
			//1新建json
			JSONObject fileJson =new JSONObject();
			//3 将订单id封装到json中
			fileJson.put("orderId", busiId);
			//4 加密
			String fileparam = ApiCommonUtils.encrypAndSign(fileJson.toJSONString(), "3");
			String fileResult=callExcuteOpApi(fileparam,"3","order_acce_moneyslip_list");
			JSONObject file=JSONObject.parseObject(fileResult);
			if(file.get("itemList")==null || "".equals(file.get("itemList").toString())){
				custaJson.put("fileFlag", "0");
			}else{
				custaJson.put("fileFlag", "1");
			}
			
			custaJson.put("retCode", "0");
			custaJson.put("retMsg", "客户账户信息获取成功");
		}  else {

			custaJson.put("retCode", "-1");
			custaJson.put("retMsg", "处理失败，请联系客服");
		}

		return custaJson.toString();
	}
	
	/**
	 * TODO 方法的描述：获取在投产品列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCastProductListPushApi() {

		//1 解密
		//String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = new JSONObject();
		//3 将一些默认数据封装到json中

		paramJson.put("begNum", "1");
		paramJson.put("fetchNum", "1000");

		//4 加密
		String newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PAYMENT_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//订单列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject obj=new JSONObject();
					//获取客户性质
					obj.put("userId", json.get("managerId"));
					
					String 	result = ApiCommonUtils.excuteOp(obj.toString(), "query_chanelid");
					JSONObject newobj=JSONObject.parseObject(result);
					
					if("0".equals(newobj.getString("retCode"))){	
						JSONObject msgobj=new JSONObject();
						
						msgobj.put("msgTitle", "在投产品提醒");
						msgobj.put("msgCont", "客户"+json.getString("Investorname")+"的订单已进入付息状态");
						msgobj.put("divType", newobj.get("osType"));
						//推送设备id
						msgobj.put("chanelId", newobj.get("chanelid"));
						
						msgobj.put("managerId", "");
						msgobj.put("orderId", "");
						
						//推送类型0 订单状态变更 1 在投产品提醒 2 客户生日提醒
						msgobj.put("noticeFlag", "2");
						
						//消息类型
						msgobj.put("msgType", "1");
						
						String 	msgresult = ApiCommonUtils.excuteOp(msgobj.toString(), "singlepush");
						JSONObject msgret=JSONObject.parseObject(msgresult);
						if(msgret.get("resultmsgId") !=null && !"".equals(msgret.get("resultmsgId").toString())){
							objParam.put("retCode", "0");
							objParam.put("retMsg", "客户生日通知发送成功");
						}else{
							objParam.put("retCode", "-1");
							objParam.put("retMsg", "处理失败，请联系客服");
						}
						
					}else{
						objParam.put("retCode", "1");
						objParam.put("retMsg", "该用户不是财富师app注册用户");
						log.info("retMsg result:该用户不是财富师app注册用户" + " 参数userId:"+obj.get("userId"));
					}	
				}
			}else{
				objParam.put("retCode", "0");
				objParam.put("retMsg", "无在投产品");
			}
			
//			
//			objParam.put("retCode", "0");
//			objParam.put("retMsg", "用户通知发送成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取在投产品提醒列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyPaymenttOrderListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);

		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		paramJson.put("managerId", paramJson.get("userId"));
		paramJson.remove("userId");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PAYMENT_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
//						//订单编号
//						newjson.put("id", json.get(""));
//						//产品编号
//						newjson.put("prodId", json.get("prodId"));
//						//产品名称
						newjson.put("prodName", json.get("proName"));
						//付息日
						newjson.put("displaytime", json.get("payDate"));
//						//订单状态
//						newjson.put("transferstatus", json.get("transferstatus"));
//						//客户编号
//						newjson.put("customerId", json.get("customerId"));
						
						JSONArray orderShow =new JSONArray();
						
						//客户
						JSONObject custjson=new JSONObject();
						custjson.put("title", "客户");
						custjson.put("value",  json.get("Investorname"));
						orderShow.add(custjson);
						
						//打款金额
						JSONObject accountjson=new JSONObject();
						accountjson.put("title", "打款金额");
						accountjson.put("value",  json.get("busiAmount").toString()+"万");
						orderShow.add(accountjson);
						

						//更新时间(待确认updateTime)
						JSONObject statusjson=new JSONObject();
						statusjson.put("title", "状态");
						statusjson.put("value",  "付息");
						
						orderShow.add(statusjson);
						
						newjson.put("orderShow", orderShow);
						newitemList.add(newjson);
					}
					objParam.put("orderList", newitemList);
				}else{
					objParam.put("orderList", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "在投产品提醒订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：面签订单提醒
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetFaceSignListPushApi() {

		//1 解密
		//String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = new JSONObject();
		//3 将一些默认数据封装到json中
		String interval = CTEConstance.getEnvProperty("facesign_interval");
		paramJson.put("interval", interval);

		//4 加密
		String newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_FACESIGN_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//订单列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject obj=new JSONObject();
					//获取客户性质
					obj.put("userId", json.get("managerId"));
					
					String 	result = ApiCommonUtils.excuteOp(obj.toString(), "query_chanelid");
					JSONObject newobj=JSONObject.parseObject(result);
					
					if("0".equals(newobj.getString("retCode"))){	
						JSONObject msgobj=new JSONObject();
						
						msgobj.put("msgTitle", "面签提醒");
						msgobj.put("msgCont", "尊敬的"+json.get("managerName")+"您好，据您预约的"+json.get("orderbegintime")+json.get("proName")+"产品面签开始还有"+json.get("remainingTime")+"分钟，请您提前做好准备，确保网络通畅！");
						msgobj.put("divType", newobj.get("osType"));
						//推送设备id
						msgobj.put("chanelId", newobj.get("chanelid"));
						
						msgobj.put("managerId", "");
						msgobj.put("orderId", "");
						
						//推送类型0 订单状态变更 1 在投产品提醒 2 客户生日提醒
						msgobj.put("noticeFlag", "2");
						
						//消息类型
						msgobj.put("msgType", "1");
						
						String 	msgresult = ApiCommonUtils.excuteOp(msgobj.toString(), "singlepush");
						JSONObject msgret=JSONObject.parseObject(msgresult);
						if(msgret.get("resultmsgId") !=null && !"".equals(msgret.get("resultmsgId").toString())){
							objParam.put("retCode", "0");
							objParam.put("retMsg", "面签提醒发送成功");
						}else{
							objParam.put("retCode", "-1");
							objParam.put("retMsg", "处理失败，请联系客服");
						}
						
					}else{
						objParam.put("retCode", "1");
						objParam.put("retMsg", "该用户不是财富师app注册用户");
						log.info("retMsg result:该用户不是财富师app注册用户" + " 参数userId:"+obj.get("userId"));
					}	
				}
			}else{
				objParam.put("retCode", "0");
				objParam.put("retMsg", "此时间段内没有面签订单");
			}
			
//			
//			objParam.put("retCode", "0");
//			objParam.put("retMsg", "用户通知发送成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：推送规定时间内过生日的客户
	 * 
	 * @param param
	 * @return
	 * @throws ParseException 
	 */
	public static String callGetCustBirthPushListApi() throws ParseException {

	
		JSONObject paramJson = new JSONObject();
		
		String dayExtend=CTEConstance.getEnvProperty("birthdayExtend");
		paramJson.put("day", dayExtend);
		paramJson.put("begNum", "1");
		paramJson.put("fetchNum", "1000");
		//4 加密
		String param = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_BIRTH_CUSTLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//规定天数内过生日的客户
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						
						//获取用户的推送ID
						JSONObject obj=new JSONObject();
						obj.put("userId", json.get("managerId"));
						String 	result = ApiCommonUtils.excuteOp(obj.toString(), "query_chanelid");
						JSONObject newobj=JSONObject.parseObject(result);
						
						if("0".equals(newobj.getString("retCode"))){	
							JSONObject msgobj=new JSONObject();
							//JSONArray custArray=new JSONArray();
							//JSONObject cust=new JSONObject();
							
							//通知标题
							msgobj.put("msgTitle", "客户生日提醒");
							
							//通知内容
							SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
							String today=df.format(new Date());// new Date()为获取当前系统时间
							
							//推送类型0 订单状态变更 1 在投产品提醒 2 客户生日提醒
							msgobj.put("noticeFlag", "2");
							int extend=daysBetween(today,today.substring(0, 4)+"-"+json.getString("mmbirthday"));
							msgobj.put("msgCont", "客户"+json.getString("investorname")+extend+"天后过生日");
							
							//推送设备类型
							msgobj.put("divType", newobj.get("osType"));
							msgobj.put("managerId", "");
							msgobj.put("orderId", "");
							msgobj.put("msgType", "1");
							//推送设备id
							msgobj.put("chanelId", newobj.get("chanelid"));
							String 	msgresult = ApiCommonUtils.excuteOp(msgobj.toString(), "singlepush");
							JSONObject msgret=JSONObject.parseObject(msgresult);
							if(msgret.get("resultmsgId") !=null && !"".equals(msgret.get("resultmsgId").toString())){
								objParam.put("retCode", "0");
								objParam.put("retMsg", "客户生日通知发送成功");
							}else{
								objParam.put("retCode", "-1");
								objParam.put("retMsg", "处理失败，请联系客服");
							}
							
						}else{
							objParam.put("retCode", "1");
							objParam.put("retMsg", "该用户不是财富师app注册用户");
							log.info("retMsg result:该用户不是财富师app注册用户" + " 参数userId:"+json.get("managerId"));
						}
				}
			
			}			
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	
	/**
	 * TODO 方法的描述：获取规定时间内过生日的客户
	 * 
	 * @param param
	 * @return
	 * @throws ParseException 
	 */
	public static String callGetCustBirthListApi(String param,String osFlag) throws ParseException {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("managerId", paramJson.get("userId"));
		//3 将一些默认数据封装到json中
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		paramJson.put("managerId", paramJson.get("userId"));
		paramJson.remove("userId");
		String dayExtend=CTEConstance.getEnvProperty("birthdayExtend");
		
		paramJson.put("day", dayExtend);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
	
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_BIRTH_CUSTLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//规定天数内过生日的客户
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
					JSONArray custArray=new  JSONArray();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						
						//获取用户的推送ID
						JSONObject obj=new JSONObject();
						//传入客户参数
						//客户姓名
						obj.put("name", json.getString("investorname"));
						
						//生日
						String birthDay=json.getString("mmbirthday");
						
						
						obj.put("birthDay", birthDay.substring(0, 2)+"月"+birthDay.substring(3, 5)+"日");
						//几天后过生日
						SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
						String today=df.format(new Date());// new Date()为获取当前系统时间
						
						int extend=daysBetween(today,today.substring(0, 4)+"-"+json.getString("mmbirthday"));
						obj.put("birthExtend", extend);
						//多少岁生日
						obj.put("age", json.getString("birthage").toString()+"岁生日");
						custArray.add(obj);
					}
					objParam.put("rowId", rowId);
					objParam.put("birthList", custArray);
					objParam.put("retCode", "0");
					objParam.put("retMsg", "客户生日列表获取成功");
			}else{
				objParam.put("birthList", "");
				objParam.put("retCode", "0");
				objParam.put("retMsg", "客户生日列表获取成功");
			}			
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：订单状态变更给财富师发送提醒
	 * 
	 * @param param
	 * @return
	 * @throws ParseException 
	 */
	public static String callUserPushApi(String param,String osFlag) {

		//1 解密
		//String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(param);
		//查询财富师推送设备ID
		String 	result = ApiCommonUtils.excuteOp(param, "query_chanelid");
		JSONObject newobj=JSONObject.parseObject(result);

		String retCode = newobj.getString("retCode");
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
	
			JSONObject msgobj=new JSONObject();
			//通知标题"msgTitle","msgCont","chanelId","divType","managerId","orderId"
			//标题
			msgobj.put("msgTitle", paramJson.get("msgTitle"));
			//内容
			msgobj.put("msgCont", paramJson.get("msgCont"));
			//推送设备ID
			msgobj.put("chanelId", newobj.get("chanelid"));
			//推送设备类型
			msgobj.put("divType", newobj.get("osType"));
			
			//推送类型0 订单状态变更 1 在投产品提醒 2 客户生日提醒
			msgobj.put("noticeFlag", "0");
			
			//财富师ID
			msgobj.put("managerId", paramJson.get("userId"));
			
			//订单编号
			msgobj.put("orderId", paramJson.get("orderId"));
			//消息类型
			msgobj.put("msgType", "2");
			
			//推送设备id
			
			
			String 	msgresult = ApiCommonUtils.excuteOp(msgobj.toString(), "singlepush");
			JSONObject msgret=JSONObject.parseObject(msgresult);
			if(msgret.get("resultmsgId") !=null && !"".equals(msgret.get("resultmsgId").toString())){
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单变更通知发送成功");
			}else{
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}
		
		}else if("1".equals(retCode)){
			objParam.put("retCode", "1");
			objParam.put("retMsg", "该用户不是财富师app注册用户");
			log.info("retMsg result:该用户不是财富师app注册用户" + " 参数userId:"+paramJson.get("managerId"));
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取订单状态变更列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyOrderUpdateListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("language", "zh_CN");
		paramJson.put("flag", "0");
		paramJson.put("managerId", paramJson.get("userId"));
		paramJson.remove("userId");
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		paramJson.put("transferstatus", "2,10,14");
		paramJson.put("cm", paramJson.get("managerId"));
		paramJson.remove("managerId");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MY_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
//						//订单编号
//						newjson.put("id", json.get(""));
//						//产品编号
//						newjson.put("prodId", json.get("prodId"));
//						//产品名称
						newjson.put("prodName", json.get("prodname"));
						//更新时间
//						newjson.put("updatetime", json.get("confirmdate"));
//						//订单状态
//						newjson.put("transferstatus", json.get("transferstatus"));
//						//客户编号
//						newjson.put("customerId", json.get("customerId"));
						
						JSONArray orderShow =new JSONArray();
						
						//客户
						JSONObject custjson=new JSONObject();
						custjson.put("title", "客户");
						custjson.put("value",  json.get("customerName"));
						orderShow.add(custjson);
						
						//打款金额
						JSONObject accountjson=new JSONObject();
						accountjson.put("title", "打款金额");
						accountjson.put("value",  json.get("busiAmount").toString()+"万");
						orderShow.add(accountjson);
						

						//更新时间(待确认updateTime)
						JSONObject statusjson=new JSONObject();
						statusjson.put("title", "状态");
						statusjson.put("value",  json.get("transferstatusvalue"));
						orderShow.add(statusjson);
						
						String a[]=new String[9];
						a[0]=json.get("begindate").toString();
						a[1]=json.get("confirmdate").toString();
						a[2]=json.get("reviewDate").toString();
						a[3]=json.get("upreviewDate").toString();
						a[4]=json.get("uploadDate").toString();
						a[5]=json.get("trialDate").toString();
						a[6]=json.get("rvDate").toString();
						a[7]=json.get("copDate").toString();
						a[8]=json.get("perfdate").toString();
						String updateTime="";
						try {
							updateTime=daysBetween(a);
						} catch (ParseException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
						
						
						newjson.put("displaytime", updateTime);
						
						newjson.put("orderShow", orderShow);
						newitemList.add(newjson);
					}
					objParam.put("orderList", newitemList);
				}else{
					objParam.put("orderList", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取根据客户经理ID查询累计服务、本月新增客户数资产
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyCustomerAsesamntApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("custManagerId", paramJson.get("userId"));
		paramJson.put("cm", paramJson.get("userId"));
		paramJson.put("locale", "zh_CN");

		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MY_CUSTOMERASESAMNT+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				//分页标识
				objParam.put("rowId", rowId);
				//标题
				objParam.put("custSumTitle", "累计服务客户数");
				//累计服务客户数
				objParam.put("custSum", objResult.get("custSum")+"人");
				//本月新增客户数
				objParam.put("newcustSumValue","(本月新增"+objResult.get("newCustNum")+"人)");
				//标题
				objParam.put("assetsTitle", "管理资产规模");
				objParam.put("assetsAmount", objResult.get("assetsAmount")+"万元");
				
				
				JSONObject custmerList=JSONObject.parseObject(callGetMyCustomerListApi(newparam,"3"));
				objParam.put("itemList", custmerList.get("itemList"));
				objParam.put("totalNum", custmerList.get("totalNum"));
				objParam.put("retCode", "0");
				objParam.put("retMsg", "客户信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取客户列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyCustomerListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		String custManagerId="";
		if(paramJson.getString("cm")==null || "".equals(paramJson.getString("cm").toString())){
			custManagerId=paramJson.getString("userId").toString();
			paramJson.put("cm", paramJson.getString("userId"));
		}else{
			custManagerId=paramJson.getString("cm").toString();
		}
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MY_CUSTOMERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//分页
				objParam.put("rowId", rowId);
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						JSONArray orderShow =new JSONArray();
						
						if(json.get("transferStatus") !=null && !"".equals(json.get("transferStatus").toString()) && !"1".equals(json.get("transferStatus").toString()) && !"2".equals(json.get("isAuthentic").toString())){
							
							newjson.put("certValue", json.get("certValue"));
							newjson.put("certno", json.get("certno"));
							
							String authenstatus=json.get("authenstatus").toString();
							String authStatus="";
							if("2".equals(authenstatus)){
								authStatus="待认证";
							}else if("3".equals(authenstatus)){
								authStatus="认证中";
							}else if("4".equals(authenstatus)){
								authStatus="审核中";
							}else if("5".equals(authenstatus)){
								authStatus="已完成";
							}else if("6".equals(authenstatus)){
								authStatus="待整改";
							}else{
								authStatus="未预约";
							}
							
							newjson.put("authStatus", authStatus);
							
							if(json.get("custAuthenId") !=null && !"".equals(json.get("custAuthenId").toString())){
								newjson.put("custAuthenId", json.get("custAuthenId"));
							}else{
								newjson.put("custAuthenId", json.get("id"));
							}
							
							
							if("1".equals(authenstatus) || "2".equals(authenstatus) || "6".equals(authenstatus)){
								newjson.put("btnFlag", "1");
							}
							
							if("2".equals(authenstatus)){
								newjson.put("extraInfo", json.get("authendate")+" "+json.get("authenbegintime")+"-"+json.get("authenendtime"));
							}else if("6".equals(authenstatus)){
								newjson.put("extraInfo", json.get("authenmemo"));
							}else{
								newjson.put("extraInfo", "");
							}
						}else{
							newjson.put("certValue", "");
							newjson.put("certno", "");
							newjson.put("authStatus", "");
							newjson.put("custAuthenId", "");
							newjson.put("extraInfo", "");
							newjson.put("btnFlag", "0");
						}
						
						//客户编号
						newjson.put("customId", json.get("id"));
						
						newjson.put("name", json.get("investorname"));
						newjson.put("level", json.get("levels"));
						
						if(json.get("investorType") !=null && !"".equals(json.get("investorType").toString())){
							if("1".equals(json.get("investorType").toString())){
								newjson.put("investorType", "普通投资者");
							}else if("2".equals(json.get("investorType").toString())){
								newjson.put("investorType", "专业投资者");
							}else{
								newjson.put("investorType", "未鉴定");
							}
						}else{
							newjson.put("investorType", "未鉴定");
						}
						
						
						//客户名称和级别
//						JSONObject json1=new JSONObject();
//						json1.put("title", json.get("investorname"));
//						json1.put("value", json.get("levels"));
//						orderShow.add(json1);
//						//客户名称
//						objParam.put("customName", json.get("investorname"));
//						//客户级别
//						objParam.put("levels", json.get("levels"));
						
						//客户证件号码
//						newjson.put("certno", json.get("certno"));
						
						
						
						
						
						JSONObject inJson=new JSONObject();
						inJson.put("rowId", "0");
						inJson.put("custManagerId",custManagerId);
						inJson.put("customerId",json.get("id"));
						inJson.put("custCertno", json.get("certno"));
						
						String inparam = ApiCommonUtils.encrypAndSign(inJson.toJSONString(), "3");
						//预约中
//						JSONObject meetResult=JSONObject.parseObject(callGetCustomerMeetOrderListApi(inparam,"3"));
						JSONObject orderNum=JSONObject.parseObject(callGetCustomerOrderNumApi(inparam,"3"));
//						//已确认
//						JSONObject confirmJson=new JSONObject();
//						confirmJson.put("rowId", "0");
//						confirmJson.put("custManagerId",custManagerId);
//						confirmJson.put("customerId",json.get("id"));
//						confirmJson.put("transferstatus","5,8,10,11,12");
//						String confirmparam = ApiCommonUtils.encrypAndSign(confirmJson.toJSONString(), "3");
//						JSONObject confirmResult=JSONObject.parseObject(callGetCustomerOrderListApi(confirmparam,"3"));
//						
//						//已成交
//						JSONObject voerJson=new JSONObject();
//						voerJson.put("rowId", "0");
//						voerJson.put("custManagerId",custManagerId);
//						voerJson.put("customerId",json.get("id"));
//						voerJson.put("transferstatus","2");
//						String overmparam = ApiCommonUtils.encrypAndSign(voerJson.toJSONString(), "3");
//						JSONObject overResult=JSONObject.parseObject(callGetCustomerOrderListApi(overmparam,"3"));
//						
//						//已退款
//						JSONObject refundJson=new JSONObject();
//						refundJson.put("rowId", "0");
//						refundJson.put("custManagerId",custManagerId);
//						refundJson.put("customerId",json.get("id"));
//						refundJson.put("transferstatus","6");
//						String refundparam = ApiCommonUtils.encrypAndSign(refundJson.toJSONString(), "3");
//						JSONObject refundResult=JSONObject.parseObject(callGetCustomerOrderListApi(refundparam,"3"));
//						
//						//存续中
//						JSONObject subsistResult=JSONObject.parseObject(callGetCustomerSubsistOrderListApi(inparam,"3"));
//						//已清算
//						JSONObject clearResult=JSONObject.parseObject(callGetCustomerClearOrderListApi(inparam,"3"));												
						
						//预约中
						JSONObject json2=new JSONObject();
						json2.put("title", "预约中");
						json2.put("value", orderNum.get("reservationNum"));
						orderShow.add(json2);
						
						//已确认
						JSONObject json3=new JSONObject();
						json3.put("title", "确认中");
						json3.put("value", orderNum.get("confirmingNum"));
						orderShow.add(json3);
						
						//已成交
						JSONObject json4=new JSONObject();
						json4.put("title", "已成交");
						json4.put("value", orderNum.get("deadDownNum"));
						orderShow.add(json4);
						
						//存续中
						JSONObject json5=new JSONObject();
						json5.put("title", "存续中");
						json5.put("value", orderNum.get("subsistingNum"));
						orderShow.add(json5);
						
						//已清算
						JSONObject json6=new JSONObject();
						json6.put("title", "已清算");
						json6.put("value", orderNum.get("clearedNum"));
						orderShow.add(json6);
						
						//已退款
						JSONObject json7=new JSONObject();
						json7.put("title", "已退款");
						json7.put("value", orderNum.get("refundedNum"));
						orderShow.add(json7);
						
						newjson.put("content", orderShow);

						newitemList.add(newjson);
					}
					objParam.put("itemList", newitemList);
				}else{
					objParam.put("itemList", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取客户所有订单列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetMyCustomerOrderListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		if(paramJson.getString("custManagerId")==null || "".equals(paramJson.getString("custManagerId").toString())){
			paramJson.put("custManagerId", paramJson.getString("userId"));
		}
		paramJson.remove("userId");
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MY_CUSTOMERORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//分页
				objParam.put("rowId", rowId);
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						JSONArray orderShow =new JSONArray();
						//产品编号
						newjson.put("orderId", json.get("id"));
						//产品名称
						newjson.put("prodName", json.get("proName"));
						
						//产品投向
						newjson.put("prodType", json.get("proType"));
						
						String a=json.get("proType").toString();
						if("0".equals(a)){
							a="1";
						}else if("3".equals(a)){
							a="2";
						}else if("1".equals(a)){
							a="3";
						}
						
						String detailUrl=CTEConstance.getEnvProperty("http_path")
						+"HTML5/html/index.html?"
						//+"&orderId="+json.get("orderId").toString()
						+"prodType="+a
						+"&id="+json.get("prodId").toString()
						+"&proCode="+json.get("proCode").toString()
						+"&orderId="+json.get("id");
						
						newjson.put("detailUrl", detailUrl);
						
						//打款金额
						JSONObject json1=new JSONObject();
						json1.put("title", "打款金额");
						json1.put("value", json.get("busiAmount")+"万");
						orderShow.add(json1);									
						
						//状态
						JSONObject json2=new JSONObject();
						json2.put("title", "状态");
						json2.put("value", json.get("statusvalue"));
						orderShow.add(json2);
						
						//更新时间
						JSONObject json3=new JSONObject();
						json3.put("title", "更新时间");
						json3.put("value", json.get("updatetime"));
						orderShow.add(json3);
						
						
						JSONObject accountObj=new JSONObject();
						accountObj.put("busiId", json.get("id"));
						String accountparam = ApiCommonUtils.encrypAndSign(accountObj.toJSONString(), "3");
						JSONObject accountResult=JSONObject.parseObject(callGetCustaDetailByOrderIdApi(accountparam,"3"));
						
						
						//付款银行卡
						JSONObject json4=new JSONObject();
						json4.put("title", "付款银行卡");
						if(accountResult.getString("acctno")==null || "".equals(accountResult.getString("acctno").toString())){
							json4.put("value", "暂无");
						}else{
							String accountId= accountResult.getString("acctno").toString();
							if(accountId.length()<4){
								json4.put("value", accountResult.get("hqvalue")+"(尾号"+accountId+")");
							}else{
								json4.put("value", accountResult.get("hqvalue")+"(尾号"+accountId.substring(accountId.length()-4,accountId.length())+")");
							}
							
						}
						
						orderShow.add(json4);
						
						
						newjson.put("content", orderShow);

						newitemList.add(newjson);
					}
					objParam.put("itemList", newitemList);
				}else{
					objParam.put("itemList", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：私募资产购买详情接口
	 * 
	 * @param param
	 * @return
	 */

	public static String callPrivateTradeDetailApi(String param, String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		String remsg = null;
		String interfaceName=null;
		if("1".equals(paramJson.get("prodType"))){//债权类
			interfaceName="/ApiServlet?opName=customer_order_claim";
		}else if("2".equals(paramJson.get("prodType"))){//现金类
			interfaceName="/ApiServlet?opName=customer_order_cash";
		}else if("3".equals(paramJson.get("prodType"))){//权益类
			interfaceName="/ApiServlet?opName=customer_order_rights";
		}else{
			interfaceName="/ApiServlet?opName=customer_order_claim";
		}
		try {
			log.info("CallApi apiName:" + API_ROOT1 + interfaceName);
			log.info("CallApi param:" + paramJson.toJSONString());
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + interfaceName+"&osFlag=3",
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		log.info("CallApi result:" + str);
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONArray productShow =new JSONArray();
		JSONObject objParam = new JSONObject();
		
		
		if ("0".equals(retCode)) {
			
			//用户id
			//objParam.put("userId", (String)paramJson.get("userId"));
			//产品类型
			objParam.put("prodType", (String)paramJson.get("prodType"));
			//更新时间
			objParam.put("updateTime", (String)objResult.get("updateTime"));
			//产品名称
			objParam.put("prodName", (String)objResult.get("prodName"));
			//订单ID
			//objParam.put("orderId", (String)paramJson.get("orderId"));
			
			//判断产品类型
			String  proType2=(String)paramJson.get("prodType");
			
			if(proType2=="1"||"1".equals(proType2)){//产品类型为固收（现改为债权）
				
				
				//已购金额
				JSONObject ygjejson=new JSONObject();
				ygjejson.put("title", "已购金额（元）");
				DecimalFormat df = new DecimalFormat("#,###"); 
				float purchasedAmount=0;
				if(objResult.get("purchasedAmount")!=null&&!"".equals(objResult.get("purchasedAmount"))){
					purchasedAmount=Float.parseFloat(objResult.get("purchasedAmount").toString());
				}
				ygjejson.put("value", (objResult.get("purchasedAmount")==null||"".equals(objResult.get("purchasedAmount")))?"--":df.format(purchasedAmount));
				productShow.add(ygjejson);
				//期限（月）
				JSONObject termjson=new JSONObject();
				termjson.put("title", "期限（月）");
				termjson.put("value", (objResult.get("termValue")==null||"".equals(objResult.get("termValue")))?"--":objResult.get("termValue"));
				productShow.add(termjson);
				//基准收益率
				JSONObject profitjson=new JSONObject();
				profitjson.put("title", "基准收益率");
				profitjson.put("value", (objResult.get("benchmarkRate")==null||"".equals(objResult.get("benchmarkRate")))?"--":objResult.get("benchmarkRate")+"%");
				productShow.add(profitjson);
				//起息时间
				JSONObject qxsjjson=new JSONObject();
				qxsjjson.put("title", "起息时间");
				qxsjjson.put("value", (objResult.get("startBenefitTime")==null||"".equals(objResult.get("startBenefitTime")))?"--":objResult.get("startBenefitTime"));
				productShow.add(qxsjjson);
				
				objParam.put("productShow", productShow);
				
				JSONArray timeShow =new JSONArray();
				//下次付息日
				JSONObject xcfxrjson=new JSONObject();
				xcfxrjson.put("title", "下次付息日");
				xcfxrjson.put("value", (objResult.get("nextInterestDay")==null||"".equals(objResult.get("nextInterestDay")))?"--":objResult.get("nextInterestDay"));
				timeShow.add(xcfxrjson);
				//预计到期日
				JSONObject yjdqrjson=new JSONObject();
				yjdqrjson.put("title", "预计到期日");
				yjdqrjson.put("value", (objResult.get("expectedDueDate")==null||"".equals(objResult.get("expectedDueDate")))?"--":objResult.get("expectedDueDate"));
				timeShow.add(yjdqrjson);
				
				objParam.put("timeShow", timeShow);
				//获取产品资料
				JSONObject proJson=new JSONObject();
 				proJson.put("prodId", paramJson.get("prodId"));
				proJson.put("rowId", "0");
				String proparam = ApiCommonUtils.encrypAndSign(proJson.toJSONString(), "3");
			    String groomList=callGetProductInfoListApi(proparam,"3");
			    JSONObject groomListJson = (JSONObject) JSONObject.parse(groomList);
			    objParam.put("infoList", groomListJson);
				
			}else if(proType2=="2"||"2".equals(proType2)){//产品类型为现金
				
				//已购份额（份）
				JSONObject ygjejson=new JSONObject();
				ygjejson.put("title", "已购金额（元）");
				DecimalFormat df = new DecimalFormat("#,###"); 
				float purchasedAmount=0;
				if(objResult.get("purchasedAmount")!=null&&!"".equals(objResult.get("purchasedAmount"))){
					purchasedAmount=Float.parseFloat(objResult.get("purchasedAmount").toString());
				}
				ygjejson.put("value", (objResult.get("purchasedAmount")==null||"".equals(objResult.get("purchasedAmount")))?"--":df.format(purchasedAmount));
				productShow.add(ygjejson);
				//存续份额（份）
				JSONObject cxfejson=new JSONObject();
				cxfejson.put("title", "可赎金额（元）");
				float subsistingAmount=0;
				if(objResult.get("subsistingAmount")!=null&&!"".equals(objResult.get("subsistingAmount"))){
					subsistingAmount=Float.parseFloat(objResult.get("subsistingAmount").toString());
				}
				cxfejson.put("value", (objResult.get("subsistingAmount")==null||"".equals(objResult.get("subsistingAmount")))?"--":df.format(subsistingAmount));
				productShow.add(cxfejson);
				//持有份额（份）
				JSONObject cyfejson=new JSONObject();
				cyfejson.put("title", "持有份额（份）");
				cyfejson.put("value", (objResult.get("holdShare")==null||"".equals(objResult.get("holdShare")))?"--":objResult.get("holdShare"));
				productShow.add(cyfejson);
				//每万份收益
				
				objParam.put("perMillionEarnings", (objResult.get("perMillionEarnings")==null||"".equals(objResult.get("perMillionEarnings")))?"--":objResult.get("perMillionEarnings"));
				//近7日年化收益
				objParam.put("sevenYearRate", (objResult.get("sevenYearRate")==null||"".equals(objResult.get("sevenYearRate")))?"--":objResult.get("sevenYearRate"));
				
				objParam.put("productShow", productShow);
				
				objParam.put("notice", "申购：T日11:00之前申购，T+1计息。赎回：T日11:00之前提出赎回申请，T+1日划款");
				
				//获取产品资料
				JSONObject proJson=new JSONObject();
				proJson.put("prodId", paramJson.get("id"));
				proJson.put("rowId", "0");
				String proparam = ApiCommonUtils.encrypAndSign(proJson.toJSONString(), "3");
			    String groomList=callGetProductInfoListApi(proparam,"3");
			    JSONObject groomListJson = (JSONObject) JSONObject.parse(groomList);
			    objParam.put("infoList", groomListJson);
				
			}else if(proType2=="3"||"3".equals(proType2)){//产品类型为权益
				
				//认购金额（元）
				JSONObject wfsyjson=new JSONObject();
				wfsyjson.put("title", "认购金额（元）");
				DecimalFormat df = new DecimalFormat("#,###"); 
				float purchasedAmount=0;
				if(objResult.get("purchasedAmount")!=null&&!"".equals(objResult.get("purchasedAmount"))){
					purchasedAmount=Float.parseFloat(objResult.get("purchasedAmount").toString());
				}
				wfsyjson.put("value", (objResult.get("purchasedAmount")==null||"".equals(objResult.get("purchasedAmount")))?"--":df.format(purchasedAmount));
				productShow.add(wfsyjson);
				// 已购份额（份）
				JSONObject ygjejson=new JSONObject();
				ygjejson.put("title", "已购份额（份）");
				ygjejson.put("value", (objResult.get("purchasedShare")==null||"".equals(objResult.get("purchasedShare")))?"--":objResult.get("purchasedShare"));
				productShow.add(ygjejson);
				//存续份额（份）
				JSONObject cxfejson=new JSONObject();
				cxfejson.put("title", "存续份额（份）");
				cxfejson.put("value", (objResult.get("subsistingShare")==null||"".equals(objResult.get("subsistingShare")))?"--":objResult.get("subsistingShare"));
				productShow.add(cxfejson);
				
				//成立日净值
				JSONObject nhsyjson=new JSONObject();
				nhsyjson.put("title", "成立日净值");
				nhsyjson.put("value", (objResult.get("foundValue")==null||"".equals(objResult.get("foundValue")))?"--":objResult.get("foundValue"));
				productShow.add(nhsyjson);
				
				objParam.put("productShow", productShow);
				
				JSONArray timeShow =new JSONArray();
				//申赎回开放日期
				JSONObject xcfxrjson=new JSONObject();
				xcfxrjson.put("title", "开放日/申购赎回规则");
				xcfxrjson.put("value", (objResult.get("opendayPurchRedemRules")==null||"".equals(objResult.get("opendayPurchRedemRules")))?"--":objResult.get("opendayPurchRedemRules"));
				timeShow.add(xcfxrjson);
				objParam.put("timeShow", timeShow);
				
				
				
				
			}else{
				//已购金额
				JSONObject ygjejson=new JSONObject();
				ygjejson.put("title", "已购金额（元）");
				DecimalFormat df = new DecimalFormat("#,###"); 
				float purchasedAmount=0;
				if(objResult.get("purchasedAmount")!=null&&!"".equals(objResult.get("purchasedAmount"))){
					purchasedAmount=Float.parseFloat(objResult.get("purchasedAmount").toString());
				}
				ygjejson.put("value", (objResult.get("purchasedAmount")==null||"".equals(objResult.get("purchasedAmount")))?"--":df.format(purchasedAmount));
				productShow.add(ygjejson);
				//期限（月）
				JSONObject termjson=new JSONObject();
				termjson.put("title", "期限（月）");
				termjson.put("value", (objResult.get("termValue")==null||"".equals(objResult.get("termValue")))?"--":objResult.get("termValue"));
				productShow.add(termjson);
				//基准收益率
				JSONObject profitjson=new JSONObject();
				profitjson.put("title", "基准收益率");
				profitjson.put("value", (objResult.get("benchmarkRate")==null||"".equals(objResult.get("benchmarkRate")))?"--":objResult.get("benchmarkRate")+"%");
				productShow.add(profitjson);
				//起息时间
				JSONObject qxsjjson=new JSONObject();
				qxsjjson.put("title", "起息时间");
				qxsjjson.put("value", (objResult.get("startBenefitTime")==null||"".equals(objResult.get("startBenefitTime")))?"--":objResult.get("startBenefitTime"));
				productShow.add(qxsjjson);
				
				objParam.put("productShow", productShow);
				
				JSONArray timeShow =new JSONArray();
				//下次付息日
				JSONObject xcfxrjson=new JSONObject();
				xcfxrjson.put("title", "下次付息日");
				xcfxrjson.put("value", (objResult.get("nextInterestDay")==null||"".equals(objResult.get("nextInterestDay")))?"--":objResult.get("nextInterestDay"));
				timeShow.add(xcfxrjson);
				//预计到期日
				JSONObject yjdqrjson=new JSONObject();
				yjdqrjson.put("title", "预计到期日");
				yjdqrjson.put("value", (objResult.get("expectedDueDate")==null||"".equals(objResult.get("expectedDueDate")))?"--":objResult.get("expectedDueDate"));
				timeShow.add(yjdqrjson);
				
				objParam.put("timeShow", timeShow);
				//获取产品资料
				JSONObject proJson=new JSONObject();
 				proJson.put("prodId", paramJson.get("prodId"));
				proJson.put("rowId", "0");
				String proparam = ApiCommonUtils.encrypAndSign(proJson.toJSONString(), "3");
			    String groomList=callGetProductInfoListApi(proparam,"3");
			    JSONObject groomListJson = (JSONObject) JSONObject.parse(groomList);
			    objParam.put("infoList", groomListJson);
			}
			
			
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "资产详情获取成功");
			
		}
		return objParam.toString();
	}
	
	public static String callGetProductInfoListApi(String param, String osFlag) {
		//1 解密
		param = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(param);
		int rowId=0;
		if(paramJson.get("rowId")!=null && !"".equals(paramJson.get("rowId").toString())){
			//3 将一些默认数据封装到json中
			int begNum = Integer.parseInt(paramJson.get("rowId").toString());
			if(begNum==0){
				begNum=1;
			}
			int fetchNum = Integer.parseInt(pageNum);
			rowId = begNum+Integer.parseInt(pageNum);
			paramJson.put("begNum", Integer.toString(begNum));
			paramJson.put("fetchNum", Integer.toString(fetchNum));
		}else{
			paramJson.put("begNum", "0");
			paramJson.put("fetchNum", "1000");
		}
		
		paramJson.put("prodId", paramJson.get("prodId"));
		
		//4 加密
		String newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			log.info("CallApi apiName:" + API_ROOT + GET_PRODUCT_INFOLIST);
			log.info("CallApi param:" + paramJson.toJSONString());
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRODUCT_INFOLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		log.info("CallApi result:" + str);
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				if(rowId!=0){
					objParam.put("rowId", rowId);
				}
				
				List<JSONObject> newitemList=new ArrayList<JSONObject>();
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//材料列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 

					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						
						String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
						JSONObject oldobj=JSONObject.parseObject(oldResult);
						String oldCode = oldobj.getString("retCode");
						
						if("0".equals(oldCode)){
							int totalnum=oldobj.getIntValue("totalNum");
							if(totalnum<1){
								JSONObject newjson=new JSONObject();

								newjson.put("httpPath", json.get("httpPath"));
								newjson.put("fileId", json.get("fileId"));
								newjson.put("fileType", json.get("fileType"));
								newjson.put("sourceId", paramJson.get("prodId"));
								
								
								//附件服务器地址
								newjson.put("fileServerPath", CTEConstance.getEnvProperty("pmfileServerPath"));
								
								//String fileparam = ApiCommonUtils.encrypAndSign(newjson.toJSONString(), "3");
								
								String fileResult = ApiCommonUtils.excuteOp(newjson.toJSONString(), "fileupload");
								JSONObject fileobj=JSONObject.parseObject(fileResult);
								String fileCode = fileobj.getString("retCode");
								
								if("0".equals(fileCode)){
									

									JSONObject custjson=new JSONObject();
									custjson.put("title", json.get("fileName"));
									custjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("httpPath").replaceAll("uploadFiles", "uploadfiles"));
									
									/*JSONObject typeObj=new JSONObject();
									typeObj.put("imageType", json.get("fileType"));
									String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
									JSONObject urlobj=JSONObject.parseObject(typeResult);
									custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));*/
									newitemList.add(custjson);
								}else{
									objParam.put("retCode", "-1");
									objParam.put("retMsg", "产品相关材料列表获取失败");
								}
							}else{
								JSONObject custjson=new JSONObject();
								custjson.put("title", oldobj.get("fileName"));
								custjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath"));
								
								//获取小图标图片地址
								/*JSONObject typeObj=new JSONObject();
								typeObj.put("imageType", oldobj.get("fileType"));
								String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
								JSONObject urlobj=JSONObject.parseObject(typeResult);
								custjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));*/
								newitemList.add(custjson);
							}
						}
						
						
						
					}
					objParam.put("content", newitemList);
				}else{
					objParam.put("content", "");
				}
				
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "产品信息列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 获取客户预约中订单列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @return
	 */
	public static String callGetCustomerMeetOrderListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);

		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT2 + GET_CUSTOMER_MEETORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("rowId", rowId);
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户预约中订单列表获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * 
	 * TODO 获取客户预约中订单列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @return
	 */
	public static String callGetCustomerOrderNumApi(String param,String osFlag) {
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMER_ORDERNUM+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户预约中订单状态数量成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * 
	 * TODO 获取客户订单列表(已确认,已成交,已退款)
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @return
	 */
	public static String callGetCustomerOrderListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);

		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMER_ORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户预约中订单列表获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * 
	 * TODO 获取客户订单列表(存续中)
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @return
	 */
	public static String callGetCustomerSubsistOrderListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);

		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMER_SUBSISTORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户预约中订单列表获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	
	/**
	 * 
	 * TODO 获取客户订单列表(已清算)
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @return
	 */
	public static String callGetCustomerClearOrderListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);

		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMER_CLEARORDERLIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户预约中订单列表获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * TODO 方法的描述：获取客户详情
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustomerInfoApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//3 将一些默认数据封装到json中
		paramJson.put("locale", "zh_CN");
		String custManagerId=paramJson.get("userId").toString();
		String customerId=paramJson.get("customerId").toString();
		paramJson.put("custManagerId", paramJson.get("userId"));
		paramJson.put("cm", paramJson.get("userId"));
		
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum =Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMER_INFO+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				objParam.put("rowId", rowId);
				objParam.put("name", objResult.get("customerName"));
				objParam.put("level", objResult.get("levels"));
				
				JSONArray custArray=new JSONArray();
				
//				JSONObject json1=new JSONObject();
//				json1.put("title", objResult.get("customerName"));
//				json1.put("value", objResult.get("levels"));
//				custArray.add(json1);
				
				JSONObject json2=new JSONObject();
				json2.put("title", "公募资产");
				json2.put("value", objResult.get("publicAssets")+"元");
				custArray.add(json2);
				
				JSONObject json3=new JSONObject();
				json3.put("title", "私募资产");
			    json3.put("value", objResult.get("privateAssets")+"万元");
				
				custArray.add(json3);
				
				JSONObject riskObj=new JSONObject();
				riskObj.put("certNo", objResult.get("certNo"));
				String riskparam = ApiCommonUtils.encrypAndSign(riskObj.toJSONString(), "3");
				JSONObject riskResult=JSONObject.parseObject(callGetCustomerRiskApi(riskparam,"3"));
				
//				JSONObject json4=new JSONObject();
//				json4.put("title", "收益权转让资产");
//				if(riskResult.get("transferAssets")==null || "".equals(riskResult.get("transferAssets").toString())){
//					json4.put("value", "0元");
//				}else{
//					json4.put("value", riskResult.get("transferAssets"));
//				}
//				
//				custArray.add(json4);
			
				
				//分页标识
				objParam.put("content", custArray);
				
				//客户信息
				JSONObject info=JSONObject.parseObject(callGetCustomerDetailApi(newparam,"3"));
				
				objParam.put("infoList", info.get("content"));

				JSONObject inJson=new JSONObject();
				inJson.put("rowId", "0");
				inJson.put("custManagerId",custManagerId);
				inJson.put("customerId",customerId);
				
				String inparam = ApiCommonUtils.encrypAndSign(inJson.toJSONString(), "3");
				//所有订单
				JSONObject order=JSONObject.parseObject(callGetMyCustomerOrderListApi(inparam,"3"));
				
				int totalNum=order.getIntValue("totalNum");
				
				objParam.put("itemList", order.get("itemList"));
				objParam.put("totalNum", Integer.toString(totalNum));
				objParam.put("retCode", "0");
				objParam.put("retMsg", "客户信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取客户个人信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustomerDetailApi(String param,String osFlag) {
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_CUSTOMER_DETAIL+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			JSONArray custInfo=new JSONArray();
			
			JSONObject json1=new JSONObject();
			json1.put("title", "手机号:");
			json1.put("value", objResult.get("mobile"));
			custInfo.add(json1);
			
			JSONObject json2=new JSONObject();
			json2.put("title", "生日:");
			json2.put("value", objResult.get("birthday"));
			custInfo.add(json2);
			
			JSONObject inobj=new JSONObject();
			inobj.put("certNo", objResult.get("certNo"));
			
			String inparam = ApiCommonUtils.encrypAndSign(inobj.toJSONString(), "3");
			JSONObject cust=JSONObject.parseObject(callGetCustomerRiskTestApi(inparam,"3"));
			
			JSONObject json3=new JSONObject();
			json3.put("title", "公募风险测试:");
			json3.put("value", cust.get("publicRiskTest"));
			custInfo.add(json3);
			
			JSONObject json4=new JSONObject();
			json4.put("title", "私募风险测试:");
			json4.put("value", cust.get("privateRiskTest"));
			custInfo.add(json4);

			objParam.put("content", custInfo);
			objParam.put("retCode", "0");
			objParam.put("retMsg", "客户信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：根据客户身份证号查询客户公私募风险测试接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustomerRiskTestApi(String param,String osFlag) {
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT2 + GET_CUSTOMER_RISKTEST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户收益权转让资产信息获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	
	/**
	 * TODO 方法的描述：根据客户身份证号查询客户收益权转让资产接口
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetCustomerRiskApi(String param,String osFlag) {
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT2 + GET_CUSTOMER_RISK+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "客户收益权转让资产信息获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	
	
	/**
	 * TODO 方法的描述：获取公告/家列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetNoticeListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式

		String 	result = ApiCommonUtils.excuteOp(newparam, "get_noticelist");
		JSONObject objResult=JSONObject.parseObject(result);
		
		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MY_CUSTOMERLIST+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {

				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));

				if(objResult.get("noticeList") !=null && !"".equals(objResult.get("noticeList").toString()) && !"0".equals(objResult.get("totalNum").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("noticeList"); 

					List<JSONObject> newitemList=new ArrayList<JSONObject>();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						
						newjson.put("fatherId", json.get("id"));
						String 	sonresult = ApiCommonUtils.excuteOp(newjson.toString(), "get_noticelist");
						JSONObject sonResult=JSONObject.parseObject(sonresult);
						
						int total=Integer.parseInt(sonResult.get("totalNum").toString());
						
						if(total==0){
							json.put("isOver", "1");
						}else{
							json.put("isOver", "0");
						}
						newitemList.add(json);
					}
					objParam.put("noticeList", newitemList);
				}else{
					objParam.put("noticeList", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "公告/家列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取公告更新信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetNoticeUpdateListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("custManagerId", paramJson.get("userId"));
		paramJson.put("rowId", "0");
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String 	result = ApiCommonUtils.excuteOp(paramJson.toJSONString(), "get_noticeupdatelist");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {


				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
					JSONArray noticeArray=new JSONArray();
					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						newjson.put("title", json.get("name"));
						newjson.put("primary", json.get("id"));
						//运营更新信息
						if("3".equals(json.get("id").toString())){
							
							String omsg=callExcuteOpApi(newparam,"3","opnews_query_opnewslist_today");
							JSONObject omobj=JSONObject.parseObject(omsg);
							if(omobj.getIntValue("totalNum")>0){
								newjson.put("value", "1");
							}else{
								newjson.put("value", "0");
							}
							
						//产品更新信息	
						}/*else if("4".equals(json.get("id").toString())){
							
							String pmsg=callExcutePmOpApi(newparam,"3","query_pronewslist_today");
							JSONObject pmobj=JSONObject.parseObject(pmsg);
							if(pmobj.getIntValue("totalNum")>0){
								newjson.put("value", "1");
							}else{
								newjson.put("value", "0");
							}
							//信息披露更新信息
						}*/else if("5".equals(json.get("id").toString())){
							
							String omsg=callExcuteOpApi(newparam,"3","infodisclosure_query_list_today");
							JSONObject omobj=JSONObject.parseObject(omsg);
							if(omobj.getIntValue("totalNum")>0){
								newjson.put("value", "1");
							}else{
								newjson.put("value", "0");
							}
								
						}else{
							newjson.put("value", json.get("status"));
						}
						
						
						newjson.put("type",json.get("type"));
						newjson.put("describe",CTEConstance.getEnvProperty("http_path")+json.get("imageUrl"));
						newjson.put("subTitle",json.get("subTitle"));

						noticeArray.add(newjson);
					}
					objParam.put("content", noticeArray);
				}else{
					objParam.put("content", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "公告更新信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取公告类别更新信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetNoticeTypeUpdateListApi(String param,String osFlag) {
		//获取公告项列表
		String optionResult=callGetNoticeOptionListApi(param,osFlag);
		JSONObject optionList=JSONObject.parseObject(optionResult);
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		String 	result = ApiCommonUtils.excuteOp(newparam, "get_noticetypeupdatelist");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			JSONArray typeArray=new JSONArray();
			String noticeId=paramJson.getString("noticeId");
			if("1".equals(noticeId)){
				String 	regResult = ApiCommonUtils.excuteOp(newparam, "get_reg_power");
				JSONObject regObjResult=JSONObject.parseObject(regResult);
				String regRetCode = regObjResult.getString("retCode");
				
				if("0".equals(regRetCode)){
					String totalNum=regObjResult.getString("totalNum");
					if(!"0".equals(totalNum)){
						String order=callGetRegOrderListpi(param,osFlag);
						JSONObject orderResult=JSONObject.parseObject(order);
						String orderTotalNum=orderResult.getString("totalNum");
						
						JSONObject json=new JSONObject();
						json.put("title", "业绩播报");
						if("0".equals(orderTotalNum)){
							json.put("value", "0");
						}else{
							json.put("value", "1");
						}
						
						json.put("primary", "0");
						Calendar c = Calendar.getInstance();//可以对每个时间域单独修改
						int year = c.get(Calendar.YEAR); 
						int month = c.get(Calendar.MONTH)+1; 
						int day = c.get(Calendar.DATE); 
						
						json.put("url", CTEConstance.getEnvProperty("http_path")+"HTML5/html/rollIndex.html?userId="+paramJson.get("userId")+"&year="+year+"&month="+month+"&day="+day);
						typeArray.add(json);
					}
				}
				
			}
			
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//公告类别列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
				
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject newjson=new JSONObject();
					newjson.put("title", json.get("name"));
					newjson.put("value", json.get("status"));
					newjson.put("primary", json.get("Type"));
					newjson.put("url", "");
					typeArray.add(newjson);
				}
				objParam.put("content", typeArray);
				
			}else{
				objParam.put("content", "");
			}
			
			objParam.put("itemList", optionList.get("itemList"));
			objParam.put("totalNum", optionList.get("totalNum"));
			objParam.put("rowId", optionList.get("rowId"));
		
			objParam.put("retCode", "0");
			objParam.put("retMsg", "公告类别更新信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取公告项信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetNoticeOptionListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson=JSONObject.parseObject(newparam);
		if(paramJson.get("noticeType") ==null || "".equals(paramJson.get("noticeType").toString())){
			paramJson.put("noticeType", "1");
		}
		//运营消息类别
		if(paramJson.get("paramId") ==null || "".equals(paramJson.get("paramId").toString()) || paramJson.get("paramId").toString().contains("all")){
			paramJson.put("paramId", "");
		}
		//主题模糊查询
		if(paramJson.get("condition") ==null || "".equals(paramJson.get("condition").toString())){
			paramJson.put("condition", "");
		}
		
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		paramJson.put("custManagerId",paramJson.get("userId"));
		
		
		String noticeId=paramJson.getString("noticeId");
		
		
		JSONObject objResult = new JSONObject();
		if("1".equals(noticeId) || "2".equals(noticeId)){
			String 	result = ApiCommonUtils.excuteOp(paramJson.toString(), "get_noticeoptionlist");
			objResult=JSONObject.parseObject(result);
			
			String retCode = objResult.getString("retCode");
			JSONObject objParam = new JSONObject();
			if ("0".equals(retCode)) {
				//总条数
				objParam.put("totalNum", objResult.get("totalNum"));
				//开始行号
				objParam.put("rowId", rowId);
				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
					
					JSONArray optionArray=new JSONArray();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						String optiontype=json.getString("optiontype");
						json.remove("newscontent");
						if("0".equals(optiontype)){
							json.put("newscontent", CTEConstance.getEnvProperty("http_path")+"HTML5/html/gonggao/market.html?noticeId="+noticeId+"&optionId="+json.get("primary"));
						}else{
							json.put("newscontent", json.get("url"));
						}
						
						optionArray.add(json);
					}
					objParam.put("itemList", optionArray);
				}else{
					objParam.put("itemList", "");
				}	
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "公告项信息获取成功");
			}  else {

				objParam.put("retCode", "-1");
				objParam.put("retMsg", "处理失败，请联系客服");
			}
			
			objResult=objParam;

		}else if("3".equals(noticeId)){
			String omparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			objResult=JSONObject.parseObject(callGetOmNoticeListApi(omparam,"3","opnews_query_list"));
			objResult.put("rowId", rowId);
		}else if("4".equals(noticeId)){
			String omparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			objResult=JSONObject.parseObject(callGetPmNoticeListApi(omparam,"3"));
			objResult.put("rowId", rowId);
		}else if("5".equals(noticeId)){
			String omparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
			objResult=JSONObject.parseObject(callGetInfoDisListApi(omparam,"3"));
			objResult.put("rowId", rowId);
		}
		
	
		return objResult.toString();
	}
	
	/**
	 * 
	 * TODO 获取运营消息列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetOmNoticeListApi(String param,String osFlag,String opName) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("totalNum", objResult.getString("totalNum"));

			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString()) || "0".equals(objResult.get("totalNum").toString())){
				objParam.put("itemList", "");	
				objParam.put("remindMsg", "暂无数据");
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//公告项id
					newjson.put("primary", json.get("id"));
					
					SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
					String date=df.format(new Date());
					String pushdate=json.getString("publishtime").substring(0, 10);
					
					//是否为最新
					if(date.equals(pushdate)){
						
						newjson.put("newflag", "1");	
					}else{
						newjson.put("newflag", "0");	
					}
							
					//消息类型
					newjson.put("paramName", json.get("opinfotypevalue"));
					//发布时间
					newjson.put("time", json.get("publishtime"));
					//公告标题
					newjson.put("title", json.get("newstitle"));
					//公告内容
					newjson.put("newscontent", CTEConstance.getEnvProperty("http_path")+"HTML5/html/gonggao/market.html?noticeId=3&userId="+paramJson.get("userId")+"&optionId="+json.get("id"));
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);		
			}
				
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "公告列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 获取信息披露消息列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetInfoDisListApi(String param,String osFlag) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1+GET_INFODIS_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("totalNum", objResult.getString("totalNum"));

			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString()) || "0".equals(objResult.get("totalNum").toString())){
				objParam.put("itemList", "");	
				objParam.put("remindMsg", "暂无数据");
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//公告项id
					newjson.put("primary", json.get("id"));
					
					SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
					String date=df.format(new Date());
					String pushdate=json.getString("publishtime").substring(0, 10);
					
					//是否为最新
					if(date.equals(pushdate)){
						
						newjson.put("newflag", "1");	
					}else{
						newjson.put("newflag", "0");	
					}
							
					//消息类型
					newjson.put("paramName", json.get("opinfotypevalue"));
					//发布时间
					newjson.put("time", json.get("publishtime"));
					//公告标题
					newjson.put("title", json.get("newstitle"));
					//公告内容
					newjson.put("newscontent", CTEConstance.getEnvProperty("http_path")+"HTML5/html/gonggao/market.html?noticeId=5&userId="+paramJson.get("userId")+"&optionId="+json.get("id"));
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);		
			}
				
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "信息披露列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 获取消息类别列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetOpnewsTypeListApi(String param,String osFlag) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		String op="";
		if("3".equals(paramJson.getString("noticeId"))){
			op=API_ROOT1+GET_OMNEWS_TYPELIST;
		}else if("5".equals(paramJson.getString("noticeId"))){
			op=API_ROOT1+GET_INFODIST_TYPELIST;
		}else{
			op=API_ROOT+GET_PRONEWS_TYPELIST;
		}
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(op+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//objParam.put("totalNum", objResult.getString("totalNum"));

			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString())){
				objParam.put("itemList", "");		
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				JSONObject alljson=new JSONObject();
				//类别名称
				alljson.put("title", "全部");
				//类别值
				alljson.put("value", "all");
				optionAyyay.add(alljson);
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//类别名称
					newjson.put("title", json.get("paramName"));
					//类别值
					newjson.put("value", json.get("paramId"));
					optionAyyay.add(newjson);
				}
				
				objParam.put("content", optionAyyay);		
			}
				
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "消息类别列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 获取产品消息列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetPmNoticeListApi(String param,String osFlag) {
		
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRONEWS_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("totalNum", objResult.getString("totalNum"));

			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString())){
				objParam.put("itemList", "");	
				objParam.put("remindMsg", "暂无数据");
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				JSONArray optionAyyay=new JSONArray();
				
				//获取状态列表
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//公告项id
					newjson.put("primary", json.get("id"));
					
					SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
					String date=df.format(new Date());
					String pushdate=json.getString("publishtime").substring(0, 10);
					
					//是否为最新
					if(date.equals(pushdate)){
						
						newjson.put("newflag", "1");	
					}else{
						newjson.put("newflag", "0");	
					}			
					//消息类型
					newjson.put("paramName", json.get("opinfotypevalue"));
					//发布时间
					newjson.put("time", json.get("publishtime"));
					//公告标题
					newjson.put("title", json.get("newstitle"));
					//公告内容
					newjson.put("newscontent", CTEConstance.getEnvProperty("http_path")+"HTML5/html/gonggao/market.html?noticeId=4&userId="+paramJson.get("userId")+"&optionId="+json.get("id"));
					optionAyyay.add(newjson);
				}

				objParam.put("itemList", optionAyyay);		
			}
				
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "公告列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	public static String callGetNoticeFileListApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		String noticeId=paramJson.getString("noticeId");
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		if("1".equals(noticeId) || "2".equals(noticeId)){
			return callGetSaleNoticeFileListApi(param,"3");
		}else if("3".equals(noticeId) || "5".equals(noticeId)){
			return callGetOmNoticeFileListApi(param,"3","opnews_query_filelist");
		}else{
			return callGetPmNoticeFileListApi(param,"3");
		}
		
	}
	
	/**
	 * 
	 * TODO 获取营销/产品公告附件列表 
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetSaleNoticeFileListApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		
		String fileResult = ApiCommonUtils.excuteOp(newparam, "get_notice_filelist");
		
		JSONObject objResult = (JSONObject) JSONObject.parse(fileResult);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			JSONArray optionAyyay=new JSONArray();	
			//附件
			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString())){
	
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//附件名
					newjson.put("title", json.get("fileName"));
					//链接
					newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.get("httpPath"));
					//newjson.put("value", CTEConstance.getEnvProperty("http_path")+"FileDownload");
					//获取小图标图片地址
					JSONObject typeObj=new JSONObject();
					typeObj.put("imageType", json.get("fileType"));
					String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
					JSONObject urlobj=JSONObject.parseObject(typeResult);
					newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
					optionAyyay.add(newjson);
				}
					
			}
			
			objParam.put("content", optionAyyay);	
			objParam.put("retCode", "0");
			objParam.put("retMsg", "附件列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 获取运营公告附件列表 
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetOmNoticeFileListApi(String param,String osFlag,String opName) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("opnewsId", paramJson.get("optionId"));
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
	
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PUBLIC_INFO+opName+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			JSONArray optionAyyay=new JSONArray();
			
			//图片附件1
			if(objResult.get("picture1List") ==null || "".equals(objResult.get("picture1List").toString())){
	
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("picture1List"); 
				
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//附件名
					newjson.put("title", json.get("filename"));
					
					JSONObject filejson=new JSONObject();
					filejson.put("httpPath", json.get("fileurl"));
					filejson.put("fileId", json.get("fileId"));
					filejson.put("fileType", json.get("fileattr"));
					filejson.put("sourceId", paramJson.get("opnewsId"));									
					
					
					String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
					JSONObject oldobj=JSONObject.parseObject(oldResult);
					String oldCode = oldobj.getString("retCode");
					
					if("0".equals(oldCode)){
						int totalnum=oldobj.getIntValue("totalNum");
						if(totalnum<1){
							//附件服务器地址
							filejson.put("fileServerPath", CTEConstance.getEnvProperty("omfileServerPath"));
							String fileResult = ApiCommonUtils.excuteOp(filejson.toJSONString(), "fileupload");
							JSONObject fileobj=JSONObject.parseObject(fileResult);
							String fileCode = fileobj.getString("retCode");
							if(!"0".equals(fileCode)){
								continue;
							}
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("fileurl").replaceAll("uploadFiles", "uploadfiles"));
							//类型
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+"images/icons/edit.png");

						}else{
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath").toString().replaceAll("uploadFiles", "uploadfiles"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", oldobj.get("fileType"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
						}
					}
					
					optionAyyay.add(newjson);
				}

			}
			
			//图片附件2
			if(objResult.get("picture2List") ==null || "".equals(objResult.get("picture2List").toString())){

			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("picture2List"); 

				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//附件名
					newjson.put("title", json.get("filename"));
					
					JSONObject filejson=new JSONObject();
					filejson.put("httpPath", json.get("fileurl"));
					filejson.put("fileId", json.get("fileId"));
					filejson.put("fileType", json.get("fileattr"));
					filejson.put("sourceId", paramJson.get("opnewsId"));	
					String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
					JSONObject oldobj=JSONObject.parseObject(oldResult);
					String oldCode = oldobj.getString("retCode");
					
					if("0".equals(oldCode)){
						int totalnum=oldobj.getIntValue("totalNum");
						if(totalnum<1){
							//附件服务器地址
							filejson.put("fileServerPath", CTEConstance.getEnvProperty("omfileServerPath"));
							String fileResult = ApiCommonUtils.excuteOp(filejson.toJSONString(), "fileupload");
							JSONObject fileobj=JSONObject.parseObject(fileResult);
							String fileCode = fileobj.getString("retCode");
							if(!"0".equals(fileCode)){
								continue;
							}
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("fileurl").replaceAll("uploadFiles", "uploadfiles"));
							//类型
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+"images/icons/edit.png");

						}else{
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath").toString().replaceAll("uploadFiles", "uploadfiles"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", oldobj.get("fileType"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
						}
					}
					
					optionAyyay.add(newjson);
				}
	
			}
			
			//其他附件
			if(objResult.get("fileList") ==null || "".equals(objResult.get("fileList").toString())){
	
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("fileList"); 
				
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//附件名
					newjson.put("title", json.get("filename"));
					
					JSONObject filejson=new JSONObject();
					filejson.put("httpPath", json.get("fileurl"));
					filejson.put("fileId", json.get("fileId"));
					filejson.put("fileType", json.get("fileattr"));
					filejson.put("sourceId", paramJson.get("opnewsId"));								
					
					String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
					JSONObject oldobj=JSONObject.parseObject(oldResult);
					String oldCode = oldobj.getString("retCode");
					
					if("0".equals(oldCode)){
						int totalnum=oldobj.getIntValue("totalNum");
						if(totalnum<1){
							//附件服务器地址
							filejson.put("fileServerPath", CTEConstance.getEnvProperty("omfileServerPath"));
							String fileResult = ApiCommonUtils.excuteOp(filejson.toJSONString(), "fileupload");
							JSONObject fileobj=JSONObject.parseObject(fileResult);
							String fileCode = fileobj.getString("retCode");
							if(!"0".equals(fileCode)){
								continue;
							}
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("fileurl").replaceAll("uploadFiles", "uploadfiles"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", json.get("fileattr"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));

						}else{
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath").toString().replaceAll("uploadFiles", "uploadfiles"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", oldobj.get("fileType"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
						}
					}
					
					optionAyyay.add(newjson);
				}
					
			}
			
			objParam.put("content", optionAyyay);	
			objParam.put("retCode", "0");
			objParam.put("retMsg", "附件列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	
	/**
	 * 
	 * TODO 获取产品公告附件列表 
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 */
	public static String callGetPmNoticeFileListApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("pronewsId", paramJson.get("optionId"));
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
	
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT + GET_PRONEWS_FILELIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			JSONArray optionAyyay=new JSONArray();	
			//附件
			if(objResult.get("itemList") ==null || "".equals(objResult.get("itemList").toString())){
	
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("itemList"); 
				
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					//附件名
					newjson.put("title", json.get("fileName"));
					
					JSONObject filejson=new JSONObject();
					filejson.put("httpPath", json.get("httpPath"));
					filejson.put("fileId", json.get("fileId"));
					filejson.put("fileType", json.get("fileType"));
					filejson.put("sourceId", paramJson.get("pronewsId"));								
					
					String oldResult = ApiCommonUtils.excuteOp(json.toJSONString(), "get_fileinfo");
					JSONObject oldobj=JSONObject.parseObject(oldResult);
					String oldCode = oldobj.getString("retCode");
					
					if("0".equals(oldCode)){
						int totalnum=oldobj.getIntValue("totalNum");
						if(totalnum<1){
							//附件服务器地址
							filejson.put("fileServerPath", CTEConstance.getEnvProperty("pmfileServerPath"));
							String fileResult = ApiCommonUtils.excuteOp(filejson.toJSONString(), "fileupload");
							JSONObject fileobj=JSONObject.parseObject(fileResult);
							String fileCode = fileobj.getString("retCode");
							if(!"0".equals(fileCode)){
								continue;
							}
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+json.getString("fileurl").replaceAll("uploadFiles", "uploadfiles"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", json.get("fileattr"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));

						}else{
							//链接
							newjson.put("value", CTEConstance.getEnvProperty("http_path")+oldobj.get("httpPath"));
							
							//获取小图标图片地址
							JSONObject typeObj=new JSONObject();
							typeObj.put("imageType", oldobj.get("fileType"));
							String typeResult = ApiCommonUtils.excuteOp(typeObj.toString(), "get_file_imagetype");
							JSONObject urlobj=JSONObject.parseObject(typeResult);
							newjson.put("type", CTEConstance.getEnvProperty("http_path")+urlobj.get("imageUrl"));
						}
					}
					
					optionAyyay.add(newjson);
				}
					
			}
			
			objParam.put("content", optionAyyay);	
			objParam.put("retCode", "0");
			objParam.put("retMsg", "附件列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
	}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取公告详情
	 * 
	 * @param param
	 * @return
	 */
	public static String callFileUploadApi(String param,String osFlag) {

		JSONObject newjson=JSONObject.parseObject(param);

//		newjson.put("httpPath", json.get("httpPath"));
//		newjson.put("fileId", json.get("fileId"));
//		newjson.put("fileType", json.get("fileType"));
//		newjson.put("sourceId", paramJson.get("prodId"));								

		//附件服务器地址
//		newjson.put("fileServerPath", CTEConstance.getEnvProperty("pmfileServerPath"));

		//String fileparam = ApiCommonUtils.encrypAndSign(newjson.toJSONString(), "3");

		String fileResult = ApiCommonUtils.excuteOp(newjson.toJSONString(), "fileupload");
		JSONObject fileobj=JSONObject.parseObject(fileResult);
		
		String retCode = fileobj.getString("retCode");
		
		JSONObject objResult=new JSONObject();
		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "附件存储成功");
		}  else {
			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}
	
		return objResult.toString();
	}

	/**
	 * TODO 方法的描述：获取公告详情
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetNoticeDetailApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson=JSONObject.parseObject(newparam);
		JSONObject objResult=new JSONObject();
		if("1".equals(paramJson.getString("noticeId")) || "2".equals(paramJson.getString("noticeId"))){
			String 	result = ApiCommonUtils.excuteOp(newparam, "get_noticedetail");
			objResult=JSONObject.parseObject(result);
		}else if("3".equals(paramJson.getString("noticeId")) || "5".equals(paramJson.getString("noticeId"))){//运营消息详情/信息披露详情
			JSONObject inJson=new JSONObject();
			inJson.put("opnewsId", paramJson.get("optionId"));
			
			String inparam = ApiCommonUtils.encrypAndSign(inJson.toJSONString(), "3");
			
			String 	result = callExcuteOpApi(inparam,"3","opnews_query_infobyid");
			JSONObject omResult=JSONObject.parseObject(result);
			
			objResult.put("title", omResult.get("newsTitle"));
			objResult.put("content", omResult.get("newsContent"));
			objResult.put("optionTime", omResult.get("publishTime"));
			objResult.put("retCode", omResult.get("retCode"));
		}else if("4".equals(paramJson.getString("noticeId"))){
			JSONObject inJson=new JSONObject();
			inJson.put("pronewsId", paramJson.get("optionId"));
			
			String inparam = ApiCommonUtils.encrypAndSign(inJson.toJSONString(), "3");
			
			String 	result = callExcutePmOpApi(inparam,"3","query_pronews_detail");
			JSONObject omResult=JSONObject.parseObject(result);
			
			objResult.put("title", omResult.get("newsTitle"));
			objResult.put("content", omResult.get("newsContent"));
			objResult.put("optionTime", omResult.get("publishTime"));
			objResult.put("retCode", omResult.get("retCode"));
		}
		
		
		String retCode = objResult.getString("retCode");
		
		if ("0".equals(retCode)) {
			
				objResult.remove("noticeId");  
				objResult.remove("noticeType");
				objResult.remove("_userId");
				objResult.remove("begNum");
				objResult.remove("fetchNum");
//				JSONObject fileJson=new JSONObject();
//				JSONArray filelist= new JSONArray();
//				fileJson.put("title", "");
//				fileJson.put("value", "");
//				filelist.add(fileJson);
				objResult.put("coutent", "");
				
				objResult.put("retCode", "0");
				objResult.put("retMsg", "公告详细信息获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * TODO 方法的描述：展业资料列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetHomeDataListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式

		String 	result = ApiCommonUtils.excuteOp(newparam, "get_homedata_list");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {


				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
					
					JSONArray dataArray = new JSONArray();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						newjson.put("title", json.get("name"));
						newjson.put("describe", CTEConstance.getEnvProperty("http_path")+json.get("imageUrl"));
						newjson.put("value", json.get("url"));
						dataArray.add(newjson);
					}
					
					objParam.put("content", dataArray);
				}else{
					objParam.put("content", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "展业资料获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：研究资讯类别列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetHomeOptionTypeListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式

		String 	result = ApiCommonUtils.excuteOp(newparam, "get_homeoption_typelist");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");
		
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {


				if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
					//订单列表
					JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
					
					JSONArray optionArray=new JSONArray();
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						newjson.put("title", json.get("name"));
						newjson.put("value", json.get("id"));
						newjson.put("describe", CTEConstance.getEnvProperty("http_path")+json.get("imageUrl"));
						optionArray.add(newjson);
					}
					objParam.put("content", optionArray);
				}else{
					objParam.put("itemList", "");
				}
				
			
				objParam.put("retCode", "0");
				objParam.put("retMsg", "研究资讯类别列表获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：研究资讯列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetHomeoptionListApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson=JSONObject.parseObject(newparam);
		//2 转化为json格式
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		
		String 	result = ApiCommonUtils.excuteOp(paramJson.toString(), "get_homeoption_list");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", objResult.get("totalNum"));
			//开始行号
			objParam.put("rowId", rowId);
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//订单列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
				
				JSONArray optionArray=new JSONArray();
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					json.put("optionContent", json.get("content"));
					optionArray.add(json);
				}
				objParam.put("itemList", optionArray);
			}else{
				objParam.put("itemList", "");
			}
			objParam.put("retCode", "0");
			objParam.put("retMsg", "研究咨询列表获取获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：研究资讯列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callInsertAdviseApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson=JSONObject.parseObject(newparam);

		paramJson.put("title", paramJson.get("content"));
		paramJson.put("type", "1");
		
		String 	result = ApiCommonUtils.excuteOp(paramJson.toString(), "insert_advise");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");

		if ("0".equals(retCode)) {		    
			    objResult.remove("userId");
				objResult.remove("content");
				objResult.remove("_userId");
				objResult.remove("title");
				objResult.remove("type");
				objResult.remove("userID");
				objResult.put("retCode", "0");
				objResult.put("retMsg", "留言存储成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * TODO 方法的描述：研究资讯列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetServicePhoneApi(String param,String osFlag) {
		
		JSONObject objResult=new JSONObject();
		
		String 	publicResult = ApiCommonUtils.excuteOp("", "get_publicinfo");
		JSONObject publicObj=JSONObject.parseObject(publicResult);
		//客服电话
		objResult.put("servicePhone", publicObj.get("phone"));
		objResult.put("retCode", publicObj.get("retCode"));
		objResult.put("retMsg", "客服电话获取成功");
		return objResult.toString();
	}
	
	/**
	 * TODO 方法的描述：插入崩溃信息
	 * 
	 * @param param
	 * @return
	 */
	public static String callInsertExceptionApi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson=JSONObject.parseObject(newparam);

		paramJson.put("system", osFlag);
		
		String 	result = ApiCommonUtils.excuteOp(paramJson.toString(), "insert_exception");
		JSONObject objResult=JSONObject.parseObject(result);
		String retCode=objResult.getString("retCode");
		JSONObject objParam = new JSONObject();
		if("0".equals(retCode)){
			objParam.put("retCode", "0");
			objParam.put("retMsg", "崩溃信息存储成功");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取当日登记订单列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetRegistOrderListApi(String param,String osFlag) {
		
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		paramJson.put("userId", "DT");
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
	
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_REGISTORDER_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=", CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", objResult.get("totalNum"));
			
			ApiCommonUtils.excuteOp("", "delete_reg_order");
			
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//订单列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
				
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					String 	orderresult = ApiCommonUtils.excuteOp(json.toString(), "insert_regist_order");
					JSONObject orderObjResult=JSONObject.parseObject(orderresult);
					String orderRetCode=orderObjResult.getString("retCode");

					if("0".equals(orderRetCode)){
						objParam.put("retCode", "0");
						objParam.put("retMsg", "当日登记订单存储成功");
					}else{
						objParam.put("retCode", "-1");
						objParam.put("retMsg", "处理失败，请联系客服");
						return objParam.toString();
					}
				}
			}
			objParam.put("retCode", "0");
			objParam.put("retMsg", "当日登记订单获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	/**
	 * TODO 方法的描述：业绩播报列表
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetRegOrderListpi(String param,String osFlag) {
		
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		JSONObject paramJson=JSONObject.parseObject(newparam);

		
		String 	result = ApiCommonUtils.excuteOp(paramJson.toString(), "get_reg_order_list");
		JSONObject objResult=JSONObject.parseObject(result);
		
		String retCode = objResult.getString("retCode");
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", objResult.get("totalNum"));

			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString())){
				//订单列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
				
				JSONArray optionArray=new JSONArray();
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject orderJson=new JSONObject();
					//标题
					orderJson.put("title", json.get("title"));
					//产品类型
					String prodtype=json.getString("prodtype");
					//产品名称
					String prodname=json.getString("prodname");
					//是否标记重点
					if("1".equals(prodtype) || prodname.contains("移民") || prodname.contains("离岸")){
						orderJson.put("keyFlag", "0");
					}else{
						orderJson.put("keyFlag", "1");
					}
					//业绩
					String busiamount=json.getString("busiamount");
					//大单标记
					if(Float.parseFloat(busiamount)>=1000){
						orderJson.put("bigFlag", "0");
					}else{
						orderJson.put("bigFlag", "1");
					}
					orderJson.put("time", json.getString("registertime").substring(11, 16));
					optionArray.add(orderJson);
				}
				objParam.put("itemList", optionArray);
			}else{
				objParam.put("itemList", "");
			}
			objParam.put("retCode", "0");
			objParam.put("retMsg", "业绩播报列表获取获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}
		return objParam.toString();
	}
	
	//--------------------------------面签相关接口----------------------------------------
	
	/**
	 * 
	 * TODO 查询预约时间与坐席数量接口
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callQueryAptListApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + QUERY_APT_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("success");
		
		JSONObject objParam = new JSONObject();
		
		if ("true".equals(retCode)) {
			JSONArray optionAyyay=new JSONArray();	
			//附件
			if(objResult.get("data") ==null || "".equals(objResult.get("data").toString())|| "[]".equals(objResult.get("data").toString())){
				objParam.put("itemList","");	
			}else{
				JSONArray arrOptionData = (JSONArray)objResult.get("data"); 
				
				for(int i=0;i<arrOptionData.size();i++){
					JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					newjson.put("startTime", json.get("startTime"));//开始时间
					newjson.put("endTime", json.get("endTime"));//结束时间
					newjson.put("timeId", json.get("id"));//时间段id
					newjson.put("operatorFreeNum", json.get("operatorFreeNum"));//空余席位
					optionAyyay.add(newjson);
				}
				objParam.put("itemList", optionAyyay);	
					
			}
			
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "预约时间列表获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", objResult.get("msg"));
		}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 预约接口
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callSaveAptListApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		if(paramJson.get("orderTypeCode") == null || "".equals(paramJson.get("orderTypeCode").toString())){
			paramJson.put("orderTypeCode", "2");
		}
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + SAVE_APT_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			if("1".equals(paramJson.get("orderTypeCode").toString())){
				objParam.put("retMsg", "客服人员已收到您的预约，请按预约时间接入视频认证");
			}else{
				objParam.put("retMsg", "客服人员已收到您的预约，请按预约时间接入视频面签");
			}
			
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 修改预约接口
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callEditAptListApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		if(paramJson.get("orderTypeCode") == null || "".equals(paramJson.get("orderTypeCode").toString())){
			paramJson.put("orderTypeCode", "2");
		}
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + CANCEL_APT_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			return callSaveAptListApi(newparam,"3");
		}else {
			log.info("retMsg result:面签预约取消失败" + " 参数orderCode :"+paramJson.getString("orderCode"));
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 取消预约接口
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callCancelAptListApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		if(paramJson.get("orderTypeCode") == null || "".equals(paramJson.get("orderTypeCode").toString())){
			paramJson.put("orderTypeCode", "2");
		}
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + CANCEL_APT_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "取消面签预约成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 获取订单预约信息接口
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callGetInterViewInfoApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("orderId", paramJson.get("orderCode"));
		if(paramJson.get("orderTypeCode") == null || "".equals(paramJson.get("orderTypeCode").toString())){
			paramJson.put("orderTypeCode", "2");
		}
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String orderDetail=callGetOrdertDetailApi(newparam,"3");
		JSONObject orderJson = (JSONObject) JSONObject.parse(orderDetail);
		
		String vvstatus=orderJson.getString("vvstatus");
		JSONObject objParam = new JSONObject();
		if("0".equals(orderJson.getString("retCode"))){
			if("2".equals(vvstatus)){

				String remsg = null;
				try {
					remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_INTERVIEW_INFO+"&osFlag="+3,
							CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
							"param=" + newparam, CALL_API_CHARSET);
				} catch (Exception e) {
					e.printStackTrace();
				}
				
				String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
				JSONObject objResult = (JSONObject) JSONObject.parse(str);
				String retCode = objResult.getString("retCode");
				
				
				
				if ("0".equals(retCode)) {
					objParam.put("bespokeDate",objResult.get("orderDate"));//预约时间段
					objParam.put("beginTime",objResult.get("orderBeginTime"));//预约时间段
					objParam.put("endTime",objResult.get("orderEndTime"));//预约时间段
					String faceSignStatus=objResult.get("faceSignStatus").toString();
					if("1".equals(faceSignStatus)){
						objParam.put("status", "未预约");
					}else if("2".equals(faceSignStatus)){
						objParam.put("status", "待面签");
					}else if("3".equals(faceSignStatus)){
						objParam.put("status", "面签中");
					}else if("4".equals(faceSignStatus)){
						objParam.put("status", "审核中");
					}else if("5".equals(faceSignStatus)){
						objParam.put("status", "已完成");
					}else if("6".equals(faceSignStatus)){
						objParam.put("status", "待整改");
					}
					objParam.put("remainingTime", objResult.get("remainingTime"));//现在距离面签开始剩余秒数
					objParam.put("endRemainingTime", objResult.get("endRemainingTime"));//现在距离面签结束剩余秒数
					objParam.put("aptId", objResult.get("aptId"));//时间段id
					objParam.put("prodName", orderJson.get("prodName"));
					objParam.put("userName", orderJson.get("investorname"));//客户
					objParam.put("certValue", orderJson.get("certValue"));//证件类型
					objParam.put("certno", orderJson.get("certno"));//证件号码
					objParam.put("busiAmount", orderJson.get("busiAmount")+"万");//打款金额
					
					objParam.put("retCode", "0");
					objParam.put("retMsg", "订单预约信息获取成功");
				}else {
					objParam.put("retCode", "-1");
					objParam.put("retMsg", "处理失败，请联系客服");
				}
			}else{
				objParam.put("bespokeDate","");//预约时间段
				objParam.put("beginTime","");//预约时间段
				objParam.put("endTime","");//预约时间段
				objParam.put("status", "未预约");
				objParam.put("remainingTime", "");//现在距离面签开始剩余秒数
				objParam.put("endRemainingTime", "");//现在距离面签结束剩余秒数
				objParam.put("aptId", "");//时间段id
				objParam.put("prodName", orderJson.get("prodName"));
				objParam.put("userName", orderJson.get("investorname"));//客户
				objParam.put("certValue", orderJson.get("certValue"));//证件类型
				objParam.put("certno", orderJson.get("certno"));//证件号码
				objParam.put("busiAmount", orderJson.get("busiAmount")+"万");//打款金额
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单信息获取成功");
			}
			
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "订单信息获取失败，请联系客服");
		}
		
		
		

		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：获取人员详情
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetPersonDetailApi(String param,String osFlag) {
		

		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PERSON_DETAIL+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + param, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		

		if ("0".equals(retCode)) {
			objResult.put("retCode", "0");
			objResult.put("retMsg", "订单详情获取成功");
		}  else {

			objResult.put("retCode", "-1");
			objResult.put("retMsg", "处理失败，请联系客服");
		}

		return objResult.toString();
	}
	
	/**
	 * 
	 * TODO 获取认证预约信息接口
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callGetPersonInterViewInfoApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String orderDetail=callGetPersonDetailApi(newparam,"3");
		JSONObject orderJson = (JSONObject) JSONObject.parse(orderDetail);
		
		String vvstatus=orderJson.getString("authonstatus");
		JSONObject objParam = new JSONObject();
		if("0".equals(orderJson.getString("retCode"))){
			if("2".equals(vvstatus)){

				String remsg = null;
				try {
					remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_INTERVIEW_INFO+"&osFlag="+3,
							CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
							"param=" + newparam, CALL_API_CHARSET);
				} catch (Exception e) {
					e.printStackTrace();
				}
				
				String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
				JSONObject objResult = (JSONObject) JSONObject.parse(str);
				String retCode = objResult.getString("retCode");
				
				
				
				if ("0".equals(retCode)) {
					objParam.put("bespokeDate",objResult.get("orderDate"));//预约时间段
					objParam.put("beginTime",objResult.get("orderBeginTime"));//预约时间段
					objParam.put("endTime",objResult.get("orderEndTime"));//预约时间段
					String faceSignStatus=objResult.get("faceSignStatus").toString();
					if("1".equals(faceSignStatus)){
						objParam.put("status", "未预约");
					}else if("2".equals(faceSignStatus)){
						objParam.put("status", "待认证");
					}else if("3".equals(faceSignStatus)){
						objParam.put("status", "认证中");
					}else if("4".equals(faceSignStatus)){
						objParam.put("status", "审核中");
					}else if("5".equals(faceSignStatus)){
						objParam.put("status", "已完成");
					}else if("6".equals(faceSignStatus)){
						objParam.put("status", "待整改");
					}
					objParam.put("remainingTime", objResult.get("remainingTime"));//现在距离面签开始剩余秒数
					objParam.put("endRemainingTime", objResult.get("endRemainingTime"));//现在距离面签结束剩余秒数
					objParam.put("aptId", objResult.get("aptId"));//时间段id
					objParam.put("userName", orderJson.get("customerName"));//客户
					objParam.put("certValue", orderJson.get("certTypeValue"));//证件类型
					objParam.put("certno", orderJson.get("certNo"));//证件号码
					
					objParam.put("retCode", "0");
					objParam.put("retMsg", "订单预约信息获取成功");
				}else {
					objParam.put("retCode", "-1");
					objParam.put("retMsg", "处理失败，请联系客服");
				}
			}else{
				objParam.put("bespokeDate","");//预约时间段
				objParam.put("beginTime","");//预约时间段
				objParam.put("endTime","");//预约时间段
				if("1".equals(vvstatus)){
					objParam.put("status", "未预约");
				}else{
					objParam.put("status", "待整改");
				}
				objParam.put("remainingTime", "");//现在距离面签开始剩余秒数
				objParam.put("endRemainingTime", "");//现在距离面签结束剩余秒数
				objParam.put("aptId", "");//时间段id
				objParam.put("userName", orderJson.get("customerName"));//客户
				objParam.put("certValue", orderJson.get("certTypeValue"));//证件类型
				objParam.put("certno", orderJson.get("certNo"));//证件号码
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "订单信息获取成功");
			}
			
		}else{
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "客户信息获取失败，请联系客服");
		}
		
		
		

		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 修改视频接通状态
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callEditAptStatusApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		if(paramJson.get("orderTypeCode") == null || "".equals(paramJson.get("orderTypeCode").toString())){
			paramJson.put("orderTypeCode", "2");
		}
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + EDIT_APT_STATUS+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("retMsg", "视频接通成功");
		}else if("-3".equals(retCode)){
			objParam.put("retCode", "-3");
			objParam.put("retMsg", "已超出预约时间，请重新预约");
		}else if("-4".equals(retCode)){
			objParam.put("retCode", "-4");
			objParam.put("retMsg", "视频接通失败");
		}else if("-5".equals(retCode)){
			objParam.put("retCode", "-5");
			objParam.put("retMsg", "面签结束，已经提交审核");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	
	/**
	 * TODO 方法的描述：私募产品预约
	 * 
	 * @param param
	 * @return
	 */
	public static String callOrderRegisterApi(String param,String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(param);
		
		//3 将一些默认数据封装到json中
		paramJson.put("orderPlatform", "1");

		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		
		
		
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 +SUBSCRIBE_PRODUCT+ "&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		if ("0".equals(retCode)) {
			objParam.put("retCode", "0");
			objParam.put("resultMsg", "预约成功");
		}else if("-2".equals(retCode)){
			objParam.put("retCode", "-2");
			objParam.put("resultMsg", "不是非标预约设定的预约平台");
		}else if("-3".equals(retCode)){
			objParam.put("retCode", "-3");
			objParam.put("resultMsg", "非标预约额度超上限");
		}else if("-4".equals(retCode)){
			objParam.put("retCode", "-4");
			objParam.put("resultMsg", "小额达到上限");
		}else{
			objParam.put("retCode", "-1");
			objParam.put("resultMsg", "处理失败，请联系客服");
		}
//		if ("0".equals(retCode)) {
//			JSONObject msgJson=new JSONObject();
//			msgJson.put("retCode", retCode);
//			msgJson.put("channelName", userResult.get("channelName"));
//			msgJson.put("channelPhone", userResult.get("channelPhone"));
//			msgJson.put("prdName", prodResult.get("proName"));
//			msgJson.put("prdCode", prodResult.get("proCode"));
//			msgJson.put("custName", userResult.get("userName"));
//			msgJson.put("custPhone", userResult.get("mobile"));
//			msgJson.put("returnDate", paramJson.get("returnDate"));
//			msgJson.put("returnTimeBegin", paramJson.get("returnTimeBegin"));
//			msgJson.put("returnTimeEnd", paramJson.get("returnTimeEnd"));
//			
//			String 	msgResult = ApiCommonUtils.excuteOp(paramJson.toString(), "send_msg_private");
//			log.info("私募短信发送结果:" + msgResult);
//		}
		
		
		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：七日年化收益率列表接口
	 * 
	 * @param param
	 * @return
	 */

	public static String callPrivateProfitListApi(String param, String osFlag) {
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		
		String queryFlag=(String) paramJson.get("queryFlag");
		String queryTime=(String) paramJson.get("queryTime");
		SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
		String interfaceName=null;
		String endTime=sdf.format(new Date());
		paramJson.put("endTime", endTime);
		Calendar canlendar = Calendar.getInstance(); 
		String startTime=null;
		
		if("0".equals(queryFlag)){//七日年化收益率
			interfaceName=GET_SEVENDAYS_LIST;
		}else if("1".equals(queryFlag)){//每万份收益
			interfaceName=GET_PRIVATE_PROFIT_LIST;
		}else if("2".equals(queryFlag)){//最新净值走势
			interfaceName=GET_PRIVATE_PROFIT_LIST;
		}
		
		
        if("1".equals(queryTime)){//近一个月
			canlendar.add(Calendar.DATE, -30); 
		}else if("2".equals(queryTime)){//近六个月
			canlendar.add(Calendar.DATE, -60); 
		}else if("3".equals(queryTime)){//近一年
			canlendar.add(Calendar.DATE, -365); 
		}else{//近三年
			canlendar.add(Calendar.DATE, -1095); 
		}
        
        startTime=sdf.format(canlendar.getTime());
        
        if(queryTime=="0"||"0".equals(queryTime)){//全部
        	startTime=null;
		}
        paramJson.put("startTime", startTime);
		
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		String remsg = null;
		try {
			log.info("CallApi apiName:" + API_ROOT1 + interfaceName);
			log.info("CallApi param:" + paramJson.toJSONString());
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + interfaceName+"&osFlag=3",
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		log.info("CallApi result:" + str);
		JSONObject objParam = new JSONObject();
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		List<JSONObject> newitemList=new ArrayList<JSONObject>();
		if ("0".equals(retCode)) {
			if(objResult.get("itemList")!=null&&!"".equals(objResult.get("itemList"))){
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
				if(!arrRespData.isEmpty() ){
					
					
					for(int i=0;i<arrRespData.size();i++){
						JSONObject json=(JSONObject)arrRespData.get(i);
						JSONObject newjson=new JSONObject();
						String fundDate=null;
						try {
							fundDate=new SimpleDateFormat("yyyy/M/d").format(sdf.parse(json.get("fundDate").toString())) ;
							ArrayList<String> array=new ArrayList<String>();
							array.add(fundDate);
							if(queryFlag=="0"||"0".equals(queryFlag)){//七日年化收益率
								array.add(json.get("saror").toString());
							}else{
								array.add(json.get("fundNav").toString());
							}
							
							
							newjson.put("value",array );
							newitemList.add(newjson);
						} catch (ParseException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
						
					}
					
					objParam.put("result", newitemList);
					objParam.put("retCode", "0");
					objParam.put("retMsg", "");
					
					// 数据格式 
					// [{"value":["1998/2/5",786],"value":["1998/2/5",786]}]
				}
			}else{
				objParam.put("result", newitemList);
				objParam.put("retCode", "-1");
				objParam.put("retMsg", "错误");
			}
			 
		}
		
		return objParam.toString();
	}
	//--------------------------------------------------KPI相关接口------------------------------------
	/**
	 * TODO 方法的描述：获取个人业绩
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetPersonKpiApi(String param,String osFlag) {
		JSONObject objParam = new JSONObject();
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		paramJson.put("custManagerId", paramJson.get("userId"));
		
		String queryDate=paramJson.getString("queryDate");
		Date d = new Date();   
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");  
        String dateNowStr = sdf.format(d);
        
        if(Integer.parseInt(queryDate)<201711){
        	objParam.put("retCode", "-3");
			objParam.put("retMsg", "这个月的KPI数据小宝没有查到哦，有问题请微信糖小宝～～");
			return objParam.toString();
        }
        
        if(Integer.parseInt(queryDate)>Integer.parseInt(dateNowStr)){
        	objParam.put("retCode", "-4");
			objParam.put("retMsg", "这个月的KPI数据小宝没有查到哦，有问题请微信糖小宝～～");
			return objParam.toString();
        }
		
		//3 将language默认语言封装到json中
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_PERSON_KPI+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		
		

		if ("0".equals(retCode)) {
//				String userInfo = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//				String userresult=callGetUserInfoApi(userInfo,"3");
//				JSONObject userObj=JSONObject.parseObject(userresult);
//				//是否是普通员工
//				if("0".equals(userObj.getString("groupLevel")) && !"6".equals(userObj.getString("groupLevel"))){
//					objParam.put("isNomal","0");
//				}else{
//					objParam.put("isNomal","1");
//				}
				
			
			
				//当月业绩进度
				//objParam.put("achievement", objResult.get("personalPerformance")+"万/"+objResult.get("performanceStandard")+"万");
				//进度
				java.text.DecimalFormat   df   =new   java.text.DecimalFormat("0.00");
				//剩余额度
				float remainamount=Float.parseFloat(objResult.get("personalPerformance").toString());
				//总额度
				float issueAmount=Float.parseFloat(objResult.get("performanceStandard").toString());					
				//当月业绩进度数值
				//objParam.put("achievementRate", df.format(remainamount/issueAmount));
				
				//进度列表
				JSONArray rateList=new JSONArray();
				
				JSONObject json=new JSONObject();
				json.put("title", "当月业绩进度");
				json.put("value", objResult.get("personalPerformance")+"万/"+objResult.get("performanceStandard")+"万");
				json.put("rate", df.format(remainamount/issueAmount));
				rateList.add(json);
				
				objParam.put("rateList", rateList);
				
				
				JSONArray contentList=new JSONArray();
				
				JSONObject json1=new JSONObject();
				json1.put("title", "新增普通会员");
				json1.put("value", objResult.get("newMember")+"人");
				json1.put("type", "1");
				contentList.add(json1);
				
				JSONObject json2=new JSONObject();
				json2.put("title", "新增VIP会员");
				json2.put("value", objResult.get("newVipMember")+"人");
				json2.put("type", "2");
				contentList.add(json2);
				
				JSONObject json3=new JSONObject();
				json3.put("title", "新增绑定VIP会员");
				json3.put("value", objResult.get("newVipBind")+"人");
				json3.put("type", "3");
				contentList.add(json3);
				
				JSONObject json4=new JSONObject();
				json4.put("title", "累计绑定VIP会员");
				json4.put("value", objResult.get("totalVipBind")+"人");
				json4.put("type", "4");
				contentList.add(json4);
				
				objParam.put("addList", contentList);
				
				
				
				int gap=Integer.parseInt(objResult.getString("freeAssessmentNumber"))-Integer.parseInt(objResult.getString("totalVipBind"));
				//免考核差距人员
				objParam.put("gapVip", "您还差<font color='red'>"+gap+"</font>名"+objResult.get("freeAssessmentType")+"即可<font color='red'>免考核</font>");
				
				if("0".equals(paramJson.getString("groupLevel"))){
					//得分列表
					JSONArray scoreList=new JSONArray();
					JSONArray score1List=new JSONArray();
					
					JSONObject score1=new JSONObject();
					score1.put("title", "业绩达成率得分");
					score1.put("value", objResult.get("achievementScore"));
					score1List.add(score1);
					
					JSONObject score2=new JSONObject();
					score2.put("title", "会员达标率得分");
					score2.put("value", objResult.get("memberComplianceRateScore"));
					score1List.add(score2);
					
					JSONObject score3=new JSONObject();
					score3.put("title", "执行力得分");
					score3.put("value", objResult.get("executionScore"));
					score1List.add(score3);
					
					scoreList.add(score1List);
					
					objParam.put("scoreList", scoreList);
					
					//考核列表
					JSONArray checkList=new JSONArray();
					
					JSONObject check1=new JSONObject();
					check1.put("title", "有效人力得分");
					
					String fen=objResult.get("effectManpowerScore").toString();
					if(Float.parseFloat(fen)<70){
						check1.put("value", "<font color='red'>"+objResult.get("effectManpowerScore")+"</font>");
					}else{
						check1.put("value", objResult.get("effectManpowerScore"));
					}
					checkList.add(check1);

					
					JSONObject check2=new JSONObject();
					check2.put("title", "岗位考核得分");
					check2.put("value", objResult.get("postExaminationScore"));
					checkList.add(check2);
					
					objParam.put("checkList", checkList);
				}else{
					objParam.put("scoreList", "");
					objParam.put("checkList", "");
				}
				
				
				//有效人力得分
				//objParam.put("effectiveManpower", objResult.get("effectManpowerScore"));
				//岗位考核得分
				//objParam.put("postAssessment", objResult.get("postExaminationScore"));
				
				
				//核算规则说明
				objParam.put("accountingRules", "1、业绩达成率得分=实际业绩/本级别月度业绩要求*100 ，最高分100分<br>"
												+"2、会员达标率得分=如果合格率M在50%（含）以上，得分为M＊100，如果合格率M在50%以下得分0分，最高分100分<br>"
												+"   会员达标率（M）＝实际会员完成数／考核要求数＊100%<br>"
												+"3、执行力得分=由业务部总经理根据员工日常纪律、执行力、团队合作等方面综合表现给予评分，最高100分<br>"
												+"4、有效人力得分 =有效人力业绩达成得分*50%*+会员达标率得分*30%*+执行力得分*20%<br>"
												+"   有效人力业绩达成得分（试用期）=实际业绩/100万*100<br>"
												+"   有效人力业绩达成得分（转正）==实际业绩/200万*100<br>"
												+"5、岗位考核得分=业绩达成率得分*50%+会员达标率得分*30%+执行力得分*20%<br>");
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "财富师kpi考核信息获取成功");
		}else if("-2".equals(retCode)){
			objParam.put("retCode", "-2");
			objParam.put("retMsg", "此财富师在OA无财富师岗位或级别信息");
		}else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 查询财富师相关会员列表信息
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callgetMenberListApi(String param,String osFlag){
		//1 解密
		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
		//2 转化为json格式
		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
		if(begNum==0){
			begNum=1;
		}
		int fetchNum = Integer.parseInt(pageNum);
		int rowId = begNum+Integer.parseInt(pageNum)-1;
		paramJson.put("begNum", Integer.toString(begNum));
		paramJson.put("fetchNum", Integer.toString(fetchNum));
		
		paramJson.put("custManagerId", paramJson.get("userId"));
		paramJson.put("memberType", paramJson.get("type"));
		//4 加密
		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
		
		String remsg = null;
		try {
			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_MEMBER_LIST+"&osFlag="+3,
					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
					"param=" + newparam, CALL_API_CHARSET);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
		JSONObject objResult = (JSONObject) JSONObject.parse(str);
		String retCode = objResult.getString("retCode");
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", objResult.get("memberNumber"));
			//开始行号
			objParam.put("rowId", rowId);
			JSONArray optionAyyay=new JSONArray();	
			objParam.put("time", paramJson.get("queryDate"));//月份
			objParam.put("show", "新增普通会员"+objResult.get("memberNumber")+"人");//结束时间
			
			if(objResult.get("itemList") !=null && !"".equals(objResult.get("itemList").toString()) && !"0".equals(objResult.get("memberNumber").toString())){
				//产品列表
				JSONArray arrRespData = (JSONArray)objResult.get("itemList"); 
				for(int i=0;i<arrRespData.size();i++){
					JSONObject json=(JSONObject)arrRespData.get(i);
					JSONObject newjson=new JSONObject();
					newjson.put("name", json.get("memberName"));//姓名
					newjson.put("mobile", json.get("memberMobile"));//手机号
					newjson.put("addTime", json.get("addTime"));//新增时间
					optionAyyay.add(newjson);
				}
				objParam.put("itemList", optionAyyay);
			}else{
				objParam.put("itemList", "");
			}
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "会员信息获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：财富管理部总经理（团队长）KPI考核
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetGroupKpiApi(String param,String osFlag) {
		
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		//3 将language默认语言封装到json中
//		//4 加密
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
//		String retCode = objResult.getString("retCode");
		String retCode="0";
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
				
				//会员达标人数
				objParam.put("standardNum", "10/15人");
				//会员达标人数值
				objParam.put("standardRate", "0.5");
				//有效人力数
				objParam.put("effectiveNum", "12/15人");
				//有效人力数数值
				objParam.put("effectiveRate", "0.5");
				
				JSONArray contentList=new JSONArray();
				
				JSONObject json1=new JSONObject();
				json1.put("title", "会员达标率得分");
				json1.put("value", "66.67");
				contentList.add(json1);
				
				JSONObject json2=new JSONObject();
				json2.put("title", "有效人力达成率得分");
				json2.put("value", "100");
				contentList.add(json2);
				
				JSONObject json3=new JSONObject();
				json3.put("title", "工作目标得分");
				json3.put("value", "90");
				contentList.add(json3);
				
				objParam.put("content", contentList);
				
				//岗位考核得分
				objParam.put("postAssessment", "83.67");
				//核算规则说明
				objParam.put("accountingRules", "岗位考核得分=会员达标率得分*40%+有效人力达成率得分*30%+工作目标得分*30%");
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "财富师kpi考核信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 查询当前团队财富师列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callgetcfsListApi(String param,String osFlag){
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
//		if(begNum==0){
//			begNum=1;
//		}
//		int fetchNum = Integer.parseInt(pageNum);
//		int rowId = begNum+Integer.parseInt(pageNum)-1;
//		paramJson.put("begNum", Integer.toString(begNum));
//		paramJson.put("fetchNum", Integer.toString(fetchNum));
//		//4 加密
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + QUERY_APT_LIST+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
//		String retCode = objResult.getString("retCode");
		String retCode="0";
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", "10");
			//开始行号
			objParam.put("rowId", "11");
			JSONArray optionAyyay=new JSONArray();	
			objParam.put("teamPerformance", "8000万");//团队业绩
			
			JSONArray contentList=new JSONArray();
			
			JSONObject json1=new JSONObject();
			json1.put("title", "新增普通会员");
			json1.put("value", "4人");
			contentList.add(json1);
			
			JSONObject json2=new JSONObject();
			json2.put("title", "新增VIP会员");
			json2.put("value", "1人");
			contentList.add(json2);
			
			JSONObject json3=new JSONObject();
			json3.put("title", "新增绑定VIP会员");
			json3.put("value", "1人");
			contentList.add(json3);
			
			JSONObject json4=new JSONObject();
			json4.put("title", "累计绑定VIP会员");
			json4.put("value", "2人");
			contentList.add(json4);
			
			objParam.put("content", contentList);
			
			//附件
//			if(objResult.get("data") ==null || "".equals(objResult.get("data").toString())|| "[]".equals(objResult.get("data").toString())){
//				objParam.put("itemList","");	
//			}else{
				//JSONArray arrOptionData = (JSONArray)objResult.get("data"); 
				
				for(int i=0;i<5;i++){
					//JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					newjson.put("url", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1508488825382&di=91a200f0d8f35a7ddf72cb68b9b93e24&imgtype=0&src=http%3A%2F%2Fg.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fdcc451da81cb39db986ef37bdb160924ab183074.jpg");//头像链接
					newjson.put("cfsId", "DT1505566");//财富师编号
					newjson.put("name", "晓凡");//财富师姓名
					newjson.put("academicTitle", "高级财富管理师");//财富师姓名
					
					JSONArray cfsList=new JSONArray();
					
					JSONObject json5=new JSONObject();
					json5.put("title", "有效人力得分");
					json5.put("value", "150");
					cfsList.add(json5);
					
					JSONObject json6=new JSONObject();
					json6.put("title", "岗位考核得分");
					json6.put("value", "85.5");
					cfsList.add(json6);
					
					newjson.put("score", cfsList);
					
					optionAyyay.add(newjson);
				}
				objParam.put("itemList", optionAyyay);	
					
//			}
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "财富师信息获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：财富中心总经理KPI考核
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetKernelKpiApi(String param,String osFlag) {
		
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		//3 将language默认语言封装到json中
//		//4 加密
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
//		String retCode = objResult.getString("retCode");
		String retCode="0";
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			
				//会员达标人数
				objParam.put("standardNum", "100/150人");
				//会员达标人数值
				objParam.put("standardRate", "0.5");
				//有效人力数
				objParam.put("effectiveNum", "120/150人");
				//有效人力数数值
				objParam.put("effectiveRate", "0.5");
				//出单人力数
				objParam.put("issueManpower", "120/150人");
				//有效人力数数值
				objParam.put("issueManpowerRate", "0.5");
				
				
				JSONArray contentList=new JSONArray();
				
				JSONObject json1=new JSONObject();
				json1.put("title", "会员达标率得分");
				json1.put("value", "66.67");
				contentList.add(json1);
				
				JSONObject json2=new JSONObject();
				json2.put("title", "有效人力达成率得分");
				json2.put("value", "100");
				contentList.add(json2);
				
				objParam.put("content", contentList);
				
				JSONArray scoreList=new JSONArray();
				
				JSONObject json3=new JSONObject();
				json3.put("title", "出单率得分");
				json3.put("value", "100");
				scoreList.add(json3);
				
				JSONObject json4=new JSONObject();
				json4.put("title", "工作目标得分");
				json4.put("value", "90");
				scoreList.add(json4);
				
				objParam.put("score", scoreList);
				
				//岗位考核得分
				objParam.put("postAssessment", "83.67");
				//核算规则说明
				objParam.put("accountingRules", "岗位考核得分=会员达标率得分*25%+出单率得分*25%+有效人力达成率得分*25%+工作目标得分*25%");
				
				objParam.put("retCode", "0");
				objParam.put("retMsg", "财富中心总经理KPI考核信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 查询当前中心团队列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callgetGroupListApi(String param,String osFlag){
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
//		if(begNum==0){
//			begNum=1;
//		}
//		int fetchNum = Integer.parseInt(pageNum);
//		int rowId = begNum+Integer.parseInt(pageNum)-1;
//		paramJson.put("begNum", Integer.toString(begNum));
//		paramJson.put("fetchNum", Integer.toString(fetchNum));
//		//4 加密
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + QUERY_APT_LIST+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
//		String retCode = objResult.getString("retCode");
		String retCode="0";
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", "10");
			//开始行号
			objParam.put("rowId", "11");
			JSONArray optionAyyay=new JSONArray();	
			objParam.put("kenrelPerformance", "20,000万");//财富中心业绩
			
			JSONArray contentList=new JSONArray();
			
			JSONObject json1=new JSONObject();
			json1.put("title", "新增普通会员");
			json1.put("value", "28人");
			contentList.add(json1);
			
			JSONObject json2=new JSONObject();
			json2.put("title", "新增VIP会员");
			json2.put("value", "50人");
			contentList.add(json2);
			
			JSONObject json3=new JSONObject();
			json3.put("title", "新增绑定VIP会员");
			json3.put("value", "40人");
			contentList.add(json3);
			
			JSONObject json4=new JSONObject();
			json4.put("title", "累计绑定VIP会员");
			json4.put("value", "240人");
			contentList.add(json4);
			
			objParam.put("content", contentList);
			
			//附件
//			if(objResult.get("data") ==null || "".equals(objResult.get("data").toString())|| "[]".equals(objResult.get("data").toString())){
//				objParam.put("itemList","");	
//			}else{
				//JSONArray arrOptionData = (JSONArray)objResult.get("data"); 
				
				for(int i=0;i<5;i++){
					//JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					
					newjson.put("groupformance", "8,000万");//团队业绩
					
					JSONArray groupContentList=new JSONArray();
					
					JSONObject json5=new JSONObject();
					json5.put("title", "新增普通会员");
					json5.put("value", "14人");
					groupContentList.add(json5);
					
					JSONObject json6=new JSONObject();
					json6.put("title", "新增VIP会员");
					json6.put("value", "25人");
					groupContentList.add(json6);
					
					JSONObject json7=new JSONObject();
					json7.put("title", "新增绑定VIP会员");
					json7.put("value", "20人");
					groupContentList.add(json7);
					
					JSONObject json8=new JSONObject();
					json8.put("title", "累计绑定VIP会员");
					json8.put("value", "120人");
					groupContentList.add(json8);
					
					newjson.put("groupContent", groupContentList);
					
					//会员达标人数
					newjson.put("standardNum", "10/15人");
					//会员达标人数值
					newjson.put("standardRate", "0.5");
					//有效人力数
					newjson.put("effectiveNum", "12/15人");
					//有效人力数数值
					newjson.put("effectiveRate", "0.5");
					
					newjson.put("url", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1508488825382&di=91a200f0d8f35a7ddf72cb68b9b93e24&imgtype=0&src=http%3A%2F%2Fg.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fdcc451da81cb39db986ef37bdb160924ab183074.jpg");//头像链接
					newjson.put("cfsId", "DT1505566");//财富师编号
					newjson.put("name", "晓凡");//财富师姓名
					newjson.put("academicTitle", "高级财富管理师");//财富师姓名
					newjson.put("postAssessment", "83.67");//岗位考核得分
					newjson.put("groupId", "2222");//团队编号
					
					
					optionAyyay.add(newjson);
				}
				objParam.put("itemList", optionAyyay);	
					
//			}
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "团队信息获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/**
	 * TODO 方法的描述：财富中心总经理KPI考核
	 * 
	 * @param param
	 * @return
	 */
	public static String callGetBusinessKpiApi(String param,String osFlag) {
		
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		//3 将language默认语言封装到json中
//		//4 加密
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + GET_ORDER_DETAIL+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG, "3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
//		String retCode = objResult.getString("retCode");
		String retCode="0";
		
		
		JSONObject objParam = new JSONObject();

		if ("0".equals(retCode)) {
			//季度标准业绩
			objParam.put("quarterlyStandard", "40000万/60000万");
			//季度标准业绩数值
			objParam.put("quarterlyStandardRate", "0.5");
			//季度利润
			objParam.put("quarterlyProfit", "800万/1000万");
			//季度利润数值
			objParam.put("quarterlyProfitRate", "0.8");
			//月度净入职人数
			objParam.put("monthlyEntry", "20/30人");
			//月度净入职人数数值
			objParam.put("monthlyEntryRate", "0.8");
			//会员达标人数
			objParam.put("standardNum", "100/150人");
			//会员达标人数值
			objParam.put("standardRate", "0.5");
			//有效人力数
			objParam.put("effectiveNum", "120/150人");
			//有效人力数数值
			objParam.put("effectiveRate", "0.5");
			//出单人力数
			objParam.put("issueManpower", "120/150人");
			//出单人力数数值
			objParam.put("issueManpowerRate", "0.5");
			
			
			JSONArray dutyList=new JSONArray();
			
			JSONObject json1=new JSONObject();
			json1.put("title", "业绩责任状达成率得分");
			json1.put("value", "66.67");
			dutyList.add(json1);
			
			JSONObject json2=new JSONObject();
			json2.put("title", "利润责任状达成率得分");
			json2.put("value", "80");
			dutyList.add(json2);
			
			objParam.put("duty", dutyList);
			
			JSONArray memberList=new JSONArray();
			
			JSONObject json3=new JSONObject();
			json3.put("title", "招聘完成率得分");
			json3.put("value", "66.67");
			memberList.add(json3);
			
			JSONObject json4=new JSONObject();
			json4.put("title", "会员达标率得分");
			json4.put("value", "83.33");
			memberList.add(json4);
			
			objParam.put("member", memberList);
			
			JSONArray scoreList=new JSONArray();
			
			JSONObject json5=new JSONObject();
			json5.put("title", "有效人力达成率得分");
			json5.put("value", "100");
			scoreList.add(json5);
			
			JSONObject json6=new JSONObject();
			json6.put("title", "会员达标率得分");
			json6.put("value", "100");
			scoreList.add(json6);
			
			objParam.put("score", scoreList);
			
			//岗位考核得分
			objParam.put("postAssessment", "79");
			//核算规则说明
			objParam.put("accountingRules", "岗位考核得分=业绩责任状达成率得分*30%+利润责任状达成率得分*30%+招聘完成率得分*10%+有效人力达成率得分*10%+出单率得分*10%+会员达标率得分*10%");
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "业务部总经理KPI考核信息获取成功");
		}  else {

			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}

		return objParam.toString();
	}
	
	/**
	 * 
	 * TODO 查询当前业务部财富中心列表
	 * <pre>
	 *
	 * </pre>
	 * @param param
	 * @param osFlag
	 * @param opName
	 * @return
	 * @throws Exception 
	 */
	public static String callgetKenrelListApi(String param,String osFlag){
//		//1 解密
//		String newparam = ApiCommonUtils.decrypAndSign(param, ApiCommonUtils.APP_CALL_FLAG, osFlag);
//		//2 转化为json格式
//		JSONObject paramJson = (JSONObject) JSONObject.parse(newparam);
//		int begNum = Integer.parseInt(paramJson.get("rowId").toString())+1;
//		if(begNum==0){
//			begNum=1;
//		}
//		int fetchNum = Integer.parseInt(pageNum);
//		int rowId = begNum+Integer.parseInt(pageNum)-1;
//		paramJson.put("begNum", Integer.toString(begNum));
//		paramJson.put("fetchNum", Integer.toString(fetchNum));
//		//4 加密
//		newparam = ApiCommonUtils.encrypAndSign(paramJson.toJSONString(), "3");
//		
//		String remsg = null;
//		try {
//			remsg = CommonHttpRequest.doHttpRequest(API_ROOT1 + QUERY_APT_LIST+"&osFlag="+3,
//					CALL_API_REQ_METHOD, CALL_API_TIME_OUT,
//					"param=" + newparam, CALL_API_CHARSET);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		
//		String str = ApiCommonUtils.decrypAndSign(remsg, ApiCommonUtils.APP_CALL_FLAG,"3");
//		JSONObject objResult = (JSONObject) JSONObject.parse(str);
//		String retCode = objResult.getString("retCode");
		String retCode="0";
		
		JSONObject objParam = new JSONObject();
		
		if ("0".equals(retCode)) {
			//总条数
			objParam.put("totalNum", "10");
			//开始行号
			objParam.put("rowId", "11");	
			JSONArray optionAyyay=new JSONArray();	
			objParam.put("businessAchievement", "30,000万");//业务部业绩
			objParam.put("businessProfit", "600万");//业务部利润
			
			JSONArray contentList=new JSONArray();
			
			JSONObject json1=new JSONObject();
			json1.put("title", "新增普通会员");
			json1.put("value", "28人");
			contentList.add(json1);
			
			JSONObject json2=new JSONObject();
			json2.put("title", "新增VIP会员");
			json2.put("value", "50人");
			contentList.add(json2);
			
			JSONObject json3=new JSONObject();
			json3.put("title", "新增绑定VIP会员");
			json3.put("value", "40人");
			contentList.add(json3);
			
			JSONObject json4=new JSONObject();
			json4.put("title", "累计绑定VIP会员");
			json4.put("value", "240人");
			contentList.add(json4);
			
			objParam.put("content", contentList);
			
			//附件
//			if(objResult.get("data") ==null || "".equals(objResult.get("data").toString())|| "[]".equals(objResult.get("data").toString())){
//				objParam.put("itemList","");	
//			}else{
				//JSONArray arrOptionData = (JSONArray)objResult.get("data"); 
				
				for(int i=0;i<5;i++){
					//JSONObject json=(JSONObject)arrOptionData.get(i);
					JSONObject newjson=new JSONObject();
					
					newjson.put("kenrelPerformance", "8,000万");//财富中心业绩
					
					JSONArray groupContentList=new JSONArray();
					
					JSONObject json5=new JSONObject();
					json5.put("title", "新增普通会员");
					json5.put("value", "14人");
					groupContentList.add(json5);
					
					JSONObject json6=new JSONObject();
					json6.put("title", "新增VIP会员");
					json6.put("value", "25人");
					groupContentList.add(json6);
					
					JSONObject json7=new JSONObject();
					json7.put("title", "新增绑定VIP会员");
					json7.put("value", "20人");
					groupContentList.add(json7);
					
					JSONObject json8=new JSONObject();
					json8.put("title", "累计绑定VIP会员");
					json8.put("value", "120人");
					groupContentList.add(json8);
					
					newjson.put("groupContent", groupContentList);
					
					//会员达标人数
					newjson.put("standardNum", "10/15人");
					//会员达标人数值
					newjson.put("standardRate", "0.5");
					//有效人力数
					newjson.put("effectiveNum", "12/15人");
					//有效人力数数值
					newjson.put("effectiveRate", "0.5");
					
					newjson.put("url", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1508488825382&di=91a200f0d8f35a7ddf72cb68b9b93e24&imgtype=0&src=http%3A%2F%2Fg.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fdcc451da81cb39db986ef37bdb160924ab183074.jpg");//头像链接
					newjson.put("cfsId", "DT1506666");//财富师编号
					newjson.put("name", "小财");//财富师姓名
					newjson.put("academicTitle", "财富中心总经理");//财富师姓名
					newjson.put("postAssessment", "89.17");//岗位考核得分
					newjson.put("kenrelId", "2222");//中心编号
					
					
					optionAyyay.add(newjson);
				}
				objParam.put("itemList", optionAyyay);	
					
//			}
			
			objParam.put("retCode", "0");
			objParam.put("retMsg", "中心信息获取成功");
		}else {
			objParam.put("retCode", "-1");
			objParam.put("retMsg", "处理失败，请联系客服");
		}


		return objParam.toString();
	}
	
	/** 
	*字符串的日期格式的计算 
	*/  
    public static int daysBetween(String smdate,String bdate) throws ParseException{  
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");  
        Calendar cal = Calendar.getInstance();    
        cal.setTime(sdf.parse(smdate));    
        long time1 = cal.getTimeInMillis();                 
        cal.setTime(sdf.parse(bdate));    
        long time2 = cal.getTimeInMillis();         
        long between_days=(time2-time1)/(1000*3600*24);  
       return Integer.parseInt(String.valueOf(between_days));     
    }  
    
    /**
     * 
     * TODO 判断两个日期大小 
     * <pre>
     *
     * </pre>
     * @param DATE1
     * @param DATE2
     * @return
     */
    public static int compare_date(String DATE1, String DATE2) {  
        
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm");
        try {
            Date dt1 = df.parse(DATE1);
            Date dt2 = df.parse(DATE2);
            if (dt1.getTime() > dt2.getTime()) {
               // System.out.println("dt1 在dt2后");
                return 1;
            } else if (dt1.getTime() < dt2.getTime()) {
                //System.out.println("dt1在dt2前");
                return -1;
            } else {
                return 0;
            }
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        return 0;
    }
    
    /** 
	*获取最大日期
	*/  
    public static String daysBetween(String[] date) throws ParseException{  
        String tmp="";
        for(int i=0;i<date.length-1;i++){
        	if(date[i]==null || "".equals(date[i])){
        		continue;
        	}
        	for(int j=i+1;j<date.length;j++){
        		if(date[j]==null || "".equals(date[j])){
            		continue;
            	}
        		if(compare_date(date[i],date[j])<0){
        			tmp=date[i];
        			date[i]=date[j];
        			date[j]=tmp;
        		}
        	}
        	
        }
        
       return date[0];     
    }  
}
